Implement logic for enabling portable mode
This commit is contained in:
16
src/86box.c
16
src/86box.c
@@ -757,6 +757,22 @@ pc_init(int argc, char *argv[])
|
||||
|
||||
path_slash(exe_path);
|
||||
|
||||
/*
|
||||
* Determine if we are running in portable mode.
|
||||
*
|
||||
* We enable portable mode if the EXE path
|
||||
* contains the global config file.
|
||||
*/
|
||||
path_append_filename(global, exe_path, GLOBAL_CONFIG_FILE);
|
||||
|
||||
FILE *fp = fopen(global, "r");
|
||||
if (fp) {
|
||||
portable_mode = 1;
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
global = NULL;
|
||||
|
||||
/*
|
||||
* Get the current working directory.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user