Use DEFAULTDIR instead of hardcoding .srb2

This commit is contained in:
Hanicef 2024-03-20 20:44:17 +01:00
parent 8794e411bd
commit 10365e943a
2 changed files with 7 additions and 7 deletions

View file

@ -1433,12 +1433,12 @@ static const char *locateWad(void)
#ifndef NOHOME #ifndef NOHOME
// find in $HOME // find in $HOME
I_OutputMsg(",HOME/.srb2"); I_OutputMsg(",HOME/" DEFAULTDIR);
if ((envstr = I_GetEnv("HOME")) != NULL) if ((envstr = I_GetEnv("HOME")) != NULL)
{ {
char *tmp = malloc(strlen(envstr) + sizeof("/.srb2")); char *tmp = malloc(strlen(envstr) + sizeof(DEFAULTDIR));
strcpy(tmp, envstr); strcpy(tmp, envstr);
strcat(tmp, "/.srb2"); strcat(tmp, DEFAULTDIR);
SEARCHWAD(envstr); SEARCHWAD(envstr);
free(tmp); free(tmp);
} }

View file

@ -3038,13 +3038,13 @@ static const char *locateWad(void)
} }
#ifndef NOHOME #ifndef NOHOME
// find in $HOME/.srb2 // find in $HOME
I_OutputMsg(",HOME/.srb2"); I_OutputMsg(",HOME/" DEFAULTDIR);
if ((envstr = I_GetEnv("HOME")) != NULL) if ((envstr = I_GetEnv("HOME")) != NULL)
{ {
char *tmp = malloc(strlen(envstr) + sizeof("/.srb2")); char *tmp = malloc(strlen(envstr) + sizeof(DEFAULTDIR));
strcpy(tmp, envstr); strcpy(tmp, envstr);
strcat(tmp, "/.srb2"); strcat(tmp, DEFAULTDIR);
SEARCHWAD(envstr); SEARCHWAD(envstr);
free(tmp); free(tmp);
} }