From 8794e411bd57d9c5017ba38137770a586c558b06 Mon Sep 17 00:00:00 2001 From: Hanicef Date: Wed, 20 Mar 2024 19:23:13 +0100 Subject: [PATCH] Don't traverse the entire HOME directory to find wads --- src/dedicated/i_system.c | 8 +++++++- src/sdl/i_system.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c index 858dfaf20..b231080a8 100644 --- a/src/dedicated/i_system.c +++ b/src/dedicated/i_system.c @@ -1433,9 +1433,15 @@ static const char *locateWad(void) #ifndef NOHOME // find in $HOME - I_OutputMsg(",HOME"); + I_OutputMsg(",HOME/.srb2"); if ((envstr = I_GetEnv("HOME")) != NULL) + { + char *tmp = malloc(strlen(envstr) + sizeof("/.srb2")); + strcpy(tmp, envstr); + strcat(tmp, "/.srb2"); SEARCHWAD(envstr); + free(tmp); + } #endif // search paths diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 9f0fa0250..c6750ce74 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -3038,10 +3038,16 @@ static const char *locateWad(void) } #ifndef NOHOME - // find in $HOME - I_OutputMsg(",HOME"); + // find in $HOME/.srb2 + I_OutputMsg(",HOME/.srb2"); if ((envstr = I_GetEnv("HOME")) != NULL) + { + char *tmp = malloc(strlen(envstr) + sizeof("/.srb2")); + strcpy(tmp, envstr); + strcat(tmp, "/.srb2"); SEARCHWAD(envstr); + free(tmp); + } #endif // search paths