summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2007-01-14 05:04:37 +0000
committerSimon Howard2007-01-14 05:04:37 +0000
commitc380b055804a0616e7ad23054d5c151cffe3399a (patch)
tree8da05018f8876469b77a0b38f5ef4b2840709827 /src
parent04e809fb794f8371ea3dd9015145ca2a35ad77a0 (diff)
downloadchocolate-doom-c380b055804a0616e7ad23054d5c151cffe3399a.tar.gz
chocolate-doom-c380b055804a0616e7ad23054d5c151cffe3399a.tar.bz2
chocolate-doom-c380b055804a0616e7ad23054d5c151cffe3399a.zip
Change interpretation of DOOMWADDIR to the classic behavior: a single
directory path where an IWAD can be found. Add DOOMWADPATH as a PATH-style list of directories to search for IWADs. This is to maintain consistency/compatibility with other ports, and so that the DOOMWADDIR name makes sense. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 828
Diffstat (limited to 'src')
-rw-r--r--src/d_iwad.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c
index 7d21c92e..519172da 100644
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -324,32 +324,32 @@ static void IdentifyIWADByName(char *name)
}
//
-// Add directories from the list in the DOOMWADDIR environment variable.
+// Add directories from the list in the DOOMWADPATH environment variable.
//
-static void AddDoomWadDirs(void)
+static void AddDoomWadPath(void)
{
- char *doomwaddir;
+ char *doomwadpath;
char *p;
- // Check the DOOMWADDIR environment variable.
+ // Check the DOOMWADPATH environment variable.
- doomwaddir = getenv("DOOMWADDIR");
+ doomwadpath = getenv("DOOMWADPATH");
- if (doomwaddir == NULL)
+ if (doomwadpath == NULL)
{
return;
}
- doomwaddir = strdup(doomwaddir);
+ doomwadpath = strdup(doomwadpath);
// Add the initial directory
- AddIWADDir(doomwaddir);
+ AddIWADDir(doomwadpath);
// Split into individual dirs within the list.
- p = doomwaddir;
+ p = doomwadpath;
for (;;)
{
@@ -379,13 +379,24 @@ static void AddDoomWadDirs(void)
static void BuildIWADDirList(void)
{
+ char *doomwaddir;
+
// Look in the current directory. Doom always does this.
AddIWADDir(".");
- // Add dirs from DOOMWADDIR
+ // Add DOOMWADDIR if it is in the environment
+
+ doomwaddir = getenv("DOOMWADDIR");
+
+ if (doomwaddir != NULL)
+ {
+ AddIWADDir(doomwaddir);
+ }
+
+ // Add dirs from DOOMWADPATH
- AddDoomWadDirs();
+ AddDoomWadPath();
#ifdef _WIN32