mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-14 08:50:53 +00:00
Merge branch 'actually-avoid-traversing-home' into 'next'
Don't traverse the entire HOME directory but for real this time See merge request STJr/SRB2!2493
This commit is contained in:
commit
fd4e69425e
2 changed files with 16 additions and 11 deletions
|
@ -1390,8 +1390,8 @@ static const char *searchWad(const char *searchDir)
|
|||
|
||||
#define CHECKWADPATH(ret) \
|
||||
do { \
|
||||
I_OutputMsg(",%s", returnWadPath); \
|
||||
if (isWadPathOk(returnWadPath)) \
|
||||
I_OutputMsg(",%s", ret); \
|
||||
if (isWadPathOk(ret)) \
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
||||
|
@ -1416,7 +1416,9 @@ static const char *locateWad(void)
|
|||
#ifndef NOCWD
|
||||
// examine current dir
|
||||
strcpy(returnWadPath, ".");
|
||||
CHECKWADPATH(NULL);
|
||||
I_OutputMsg(",%s", returnWadPath);
|
||||
if (isWadPathOk(returnWadPath))
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
@ -1433,13 +1435,13 @@ static const char *locateWad(void)
|
|||
|
||||
#ifndef NOHOME
|
||||
// find in $HOME
|
||||
I_OutputMsg(",HOME/" DEFAULTDIR);
|
||||
if ((envstr = I_GetEnv("HOME")) != NULL)
|
||||
{
|
||||
char *tmp = malloc(strlen(envstr) + sizeof(DEFAULTDIR));
|
||||
char *tmp = malloc(strlen(envstr) + 1 + sizeof(DEFAULTDIR));
|
||||
strcpy(tmp, envstr);
|
||||
strcat(tmp, "/");
|
||||
strcat(tmp, DEFAULTDIR);
|
||||
SEARCHWAD(envstr);
|
||||
CHECKWADPATH(tmp);
|
||||
free(tmp);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3003,8 +3003,8 @@ static const char *searchWad(const char *searchDir)
|
|||
|
||||
#define CHECKWADPATH(ret) \
|
||||
do { \
|
||||
I_OutputMsg(",%s", returnWadPath); \
|
||||
if (isWadPathOk(returnWadPath)) \
|
||||
I_OutputMsg(",%s", ret); \
|
||||
if (isWadPathOk(ret)) \
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
||||
|
@ -3033,7 +3033,9 @@ static const char *locateWad(void)
|
|||
#ifndef NOCWD
|
||||
// examine current dir
|
||||
strcpy(returnWadPath, ".");
|
||||
CHECKWADPATH(NULL);
|
||||
I_OutputMsg(",%s", returnWadPath);
|
||||
if (isWadPathOk(returnWadPath))
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
@ -3053,10 +3055,11 @@ static const char *locateWad(void)
|
|||
I_OutputMsg(",HOME/" DEFAULTDIR);
|
||||
if ((envstr = I_GetEnv("HOME")) != NULL)
|
||||
{
|
||||
char *tmp = malloc(strlen(envstr) + sizeof(DEFAULTDIR));
|
||||
char *tmp = malloc(strlen(envstr) + 1 + sizeof(DEFAULTDIR));
|
||||
strcpy(tmp, envstr);
|
||||
strcat(tmp, "/");
|
||||
strcat(tmp, DEFAULTDIR);
|
||||
SEARCHWAD(envstr);
|
||||
CHECKWADPATH(tmp);
|
||||
free(tmp);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue