summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/app.c b/src/app.c
index 43568ba6..1f29b28a 100644
--- a/src/app.c
+++ b/src/app.c
@@ -224,6 +224,14 @@ static const char *dataDir_App_(void) {
224 return concatPath_CStr(configHome, "lagrange"); 224 return concatPath_CStr(configHome, "lagrange");
225 } 225 }
226#endif 226#endif
227#if defined (iPlatformMsys)
228 /* Check for a portable userdata directory. */
229 iApp *d = &app_;
230 const char *userDir = concatPath_CStr(cstr_String(d->execPath), "..\\userdata");
231 if (fileExistsCStr_FileInfo(userDir)) {
232 return userDir;
233 }
234#endif
227 return defaultDataDir_App_; 235 return defaultDataDir_App_;
228} 236}
229 237
@@ -381,10 +389,6 @@ static uint32_t checkAsleep_App_(uint32_t interval, void *param) {
381#endif 389#endif
382 390
383static void init_App_(iApp *d, int argc, char **argv) { 391static void init_App_(iApp *d, int argc, char **argv) {
384 const iBool isFirstRun = !fileExistsCStr_FileInfo(cleanedPath_CStr(dataDir_App_()));
385 d->isFinishedLaunching = iFalse;
386 d->launchCommands = new_StringList();
387 iZap(d->lastDropTime);
388 init_CommandLine(&d->args, argc, argv); 392 init_CommandLine(&d->args, argc, argv);
389 /* Where was the app started from? We ask SDL first because the command line alone is 393 /* Where was the app started from? We ask SDL first because the command line alone is
390 not a reliable source of this information, particularly when it comes to different 394 not a reliable source of this information, particularly when it comes to different
@@ -399,6 +403,10 @@ static void init_App_(iApp *d, int argc, char **argv) {
399 } 403 }
400 SDL_free(exec); 404 SDL_free(exec);
401 } 405 }
406 const iBool isFirstRun = !fileExistsCStr_FileInfo(cleanedPath_CStr(dataDir_App_()));
407 d->isFinishedLaunching = iFalse;
408 d->launchCommands = new_StringList();
409 iZap(d->lastDropTime);
402 init_SortedArray(&d->tickers, sizeof(iTicker), cmp_Ticker_); 410 init_SortedArray(&d->tickers, sizeof(iTicker), cmp_Ticker_);
403 d->lastTickerTime = SDL_GetTicks(); 411 d->lastTickerTime = SDL_GetTicks();
404 d->elapsedSinceLastTicker = 0; 412 d->elapsedSinceLastTicker = 0;