summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-29 06:35:49 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-29 06:35:49 +0300
commitb99c6e693b8ade1fa117f4cb54105366a7768da0 (patch)
tree9c79e3ea0fd30105930e07b57590f5d74f1d1ec8 /src/app.c
parent790273d337569439d37226e4458c128ad927bc4a (diff)
App: resources.lgr load order
Try loading from the local directory first, then the system-wide one. This way uninstalled builds are more likely to use the right resources. IssueID #363
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/app.c b/src/app.c
index 5f7776b0..73771609 100644
--- a/src/app.c
+++ b/src/app.c
@@ -699,9 +699,8 @@ static void init_App_(iApp *d, int argc, char **argv) {
699#endif 699#endif
700 d->isDarkSystemTheme = iTrue; /* will be updated by system later on, if supported */ 700 d->isDarkSystemTheme = iTrue; /* will be updated by system later on, if supported */
701 init_CommandLine(&d->args, argc, argv); 701 init_CommandLine(&d->args, argc, argv);
702 /* Where was the app started from? We ask SDL first because the command line alone is 702 /* Where was the app started from? We ask SDL first because the command line alone
703 not a reliable source of this information, particularly when it comes to different 703 cannot be relied on (behavior differs depending on OS). */ {
704 operating systems. */ {
705 char *exec = SDL_GetBasePath(); 704 char *exec = SDL_GetBasePath();
706 if (exec) { 705 if (exec) {
707 d->execPath = newCStr_String(concatPath_CStr( 706 d->execPath = newCStr_String(concatPath_CStr(
@@ -713,9 +712,10 @@ static void init_App_(iApp *d, int argc, char **argv) {
713 SDL_free(exec); 712 SDL_free(exec);
714 } 713 }
715#if defined (iHaveLoadEmbed) 714#if defined (iHaveLoadEmbed)
716 /* Load the resources from a file. */ { 715 /* Load the resources from a file. Check the executable directory first, then a
717 if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) { 716 system-wide location, and as a final fallback, the current working directory. */ {
718 if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN2))) { 717 if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN2))) {
718 if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) {
719 if (!load_Embed("resources.lgr")) { 719 if (!load_Embed("resources.lgr")) {
720 fprintf(stderr, "failed to load resources: %s\n", strerror(errno)); 720 fprintf(stderr, "failed to load resources: %s\n", strerror(errno));
721 exit(-1); 721 exit(-1);