update and simplify the windows portable_device_paths sysconf option

Requires a sysconf file in the windows executable directory in order to work
This commit is contained in:
nhmall
2019-12-17 23:16:44 -05:00
parent 0ee445ce0b
commit 5f0d06fb80
7 changed files with 70 additions and 131 deletions

View File

@@ -2466,12 +2466,6 @@ char *origbuf;
if (sysopt.dumplogfile)
free((genericptr_t) sysopt.dumplogfile);
sysopt.dumplogfile = dupstr(bufp);
#endif
#ifdef WIN32
} else if (src == SET_IN_SYS && match_varname(buf, "portable_device_top", 8)) {
if (sysopt.portable_device_top)
free((genericptr_t) sysopt.portable_device_top);
sysopt.portable_device_top = dupstr(bufp);
#endif
} else if (src == SET_IN_SYS && match_varname(buf, "GENERICUSERS", 12)) {
if (sysopt.genericusers)
@@ -2605,6 +2599,16 @@ char *origbuf;
return FALSE;
}
sysopt.accessibility = n;
#ifdef WIN32
} else if (src == SET_IN_SYS
&& match_varname(buf, "portable_device_paths", 8)) {
n = atoi(bufp);
if (n < 0 || n > 1) {
config_error_add("Illegal value in portable_device_paths (not 0,1).");
return FALSE;
}
sysopt.portable_device_paths = n;
#endif
#endif /* SYSCF */
} else if (match_varname(buf, "BOULDER", 3)) {
@@ -4160,11 +4164,10 @@ reveal_paths(VOID_ARGS)
raw_printf("No end-of-game disclosure file (%s).", nodumpreason);
#ifdef WIN32
if (sysopt.portable_device_top) {
if (sysopt.portable_device_paths) {
const char *pd = get_portable_device();
raw_printf("Writable folder for portable device config (sysconf %s):",
"portable_device_top");
raw_printf("portable_device_paths (set in sysconf):");
raw_printf(" \"%s\"", pd);
}
#endif