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:
21
src/files.c
21
src/files.c
@@ -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
|
||||
|
||||
12
src/sys.c
12
src/sys.c
@@ -34,9 +34,6 @@ sys_early_init()
|
||||
#endif
|
||||
#ifdef DUMPLOG
|
||||
sysopt.dumplogfile = (char *) 0;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
sysopt.portable_device_top = (char *) 0;
|
||||
#endif
|
||||
sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */
|
||||
sysopt.shellers = (char *) 0;
|
||||
@@ -84,6 +81,9 @@ sys_early_init()
|
||||
sysopt.seduce = 1; /* if it's compiled in, default to on */
|
||||
sysopt_seduce_set(sysopt.seduce);
|
||||
sysopt.accessibility = 0;
|
||||
#ifdef WIN32
|
||||
sysopt.portable_device_paths = 0;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -106,12 +106,6 @@ sysopt_release()
|
||||
#ifdef DUMPLOG
|
||||
if (sysopt.dumplogfile)
|
||||
free((genericptr_t)sysopt.dumplogfile), sysopt.dumplogfile=(char *)0;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
if (sysopt.portable_device_top) {
|
||||
free((genericptr_t) sysopt.portable_device_top);
|
||||
sysopt.portable_device_top = (char *) 0;
|
||||
}
|
||||
#endif
|
||||
if (sysopt.genericusers)
|
||||
free((genericptr_t) sysopt.genericusers),
|
||||
|
||||
Reference in New Issue
Block a user