mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-27 03:31:08 +00:00
Don't traverse the entire HOME directory to find wads
This commit is contained in:
parent
940756ad62
commit
8794e411bd
2 changed files with 15 additions and 3 deletions
|
@ -1433,9 +1433,15 @@ static const char *locateWad(void)
|
||||||
|
|
||||||
#ifndef NOHOME
|
#ifndef NOHOME
|
||||||
// find in $HOME
|
// find in $HOME
|
||||||
I_OutputMsg(",HOME");
|
I_OutputMsg(",HOME/.srb2");
|
||||||
if ((envstr = I_GetEnv("HOME")) != NULL)
|
if ((envstr = I_GetEnv("HOME")) != NULL)
|
||||||
|
{
|
||||||
|
char *tmp = malloc(strlen(envstr) + sizeof("/.srb2"));
|
||||||
|
strcpy(tmp, envstr);
|
||||||
|
strcat(tmp, "/.srb2");
|
||||||
SEARCHWAD(envstr);
|
SEARCHWAD(envstr);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// search paths
|
// search paths
|
||||||
|
|
|
@ -3038,10 +3038,16 @@ static const char *locateWad(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NOHOME
|
#ifndef NOHOME
|
||||||
// find in $HOME
|
// find in $HOME/.srb2
|
||||||
I_OutputMsg(",HOME");
|
I_OutputMsg(",HOME/.srb2");
|
||||||
if ((envstr = I_GetEnv("HOME")) != NULL)
|
if ((envstr = I_GetEnv("HOME")) != NULL)
|
||||||
|
{
|
||||||
|
char *tmp = malloc(strlen(envstr) + sizeof("/.srb2"));
|
||||||
|
strcpy(tmp, envstr);
|
||||||
|
strcat(tmp, "/.srb2");
|
||||||
SEARCHWAD(envstr);
|
SEARCHWAD(envstr);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// search paths
|
// search paths
|
||||||
|
|
Loading…
Reference in a new issue