--- wl_def.h.orig 2010-07-06 19:03:42.344721689 -0500 +++ wl_def.h 2010-07-06 19:18:13.835684667 -0500 @@ -915,7 +915,8 @@ extern boolean startgame; extern char str[80]; -extern char configname[13]; +extern char configdir[64]; +extern char configname[78]; // // Command line parameter variables --- wl_main.cpp.orig 2010-07-06 19:03:49.785686193 -0500 +++ wl_main.cpp 2010-07-06 19:37:10.552700785 -0500 @@ -73,7 +73,8 @@ boolean loadedgame; int mouseadjustment; -char configname[13]="config."; +char configdir[64]; +char configname[78]; // // Command line parameter variables @@ -247,6 +248,12 @@ fs_unlink(configname); #endif + // Ensure configdir exists and create if necessary + struct stat st; + if (stat(configdir, &st) != 0) { + mkdir(configdir, 0755); + } + const int file = open(configname, O_CREAT | O_WRONLY | O_BINARY, 0644); if (file != -1) { --- wl_menu.cpp.orig 2010-07-06 19:03:57.883723973 -0500 +++ wl_menu.cpp 2010-07-06 19:28:32.434697403 -0500 @@ -3993,6 +3993,18 @@ { struct stat statbuf; +// Set config location to home directory for multi-user support +// Also support separate configuration files for wolf3d and sod +strcpy(configdir, getenv("HOME")); +strcat(configdir, "/.wolf4sdl"); +#ifdef SPEAR + strcpy(configname, configdir); + strcat(configname, "/spear."); +#else + strcpy(configname, configdir); + strcat(configname, "/wolf3d."); +#endif + // // JAPANESE VERSION //