Skip to content

Commit ca1ec5e

Browse files
committed
SDL: restore last folder when no other args
1 parent 35c563d commit ca1ec5e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/platform/sdl/main.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ int main(int argc, char* argv[]) {
263263
char *fontFamily = NULL;
264264
char *runFile = NULL;
265265
bool debug = false;
266-
bool restoreDir = true;
267266
int fontScale;
268267
int ide_option = -1;
269268
SDL_Rect rect;
@@ -281,9 +280,7 @@ int main(int argc, char* argv[]) {
281280
&& ((strcasecmp(s + len - 4, ".bas") == 0 && access(s, 0) == 0)
282281
|| (strstr(s, "://") != NULL))) {
283282
runFile = strdup(s);
284-
} else if (chdir(s) == 0) {
285-
restoreDir = false;
286-
} else {
283+
} else if (chdir(s) != 0) {
287284
strcpy(opt_command, s);
288285
}
289286
}
@@ -347,7 +344,7 @@ int main(int argc, char* argv[]) {
347344
}
348345
}
349346

350-
restoreSettings(rect, fontScale, debug, restoreDir);
347+
restoreSettings(rect, fontScale, debug, argc == 1);
351348
if (ide_option != -1) {
352349
opt_ide = ide_option;
353350
}

0 commit comments

Comments
 (0)