From d464bc4dfe394a5c66ff354f9fd443c3cbf048d1 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 14 Dec 2020 20:46:45 +0000 Subject: [PATCH] SDL: Fix Windows build never searching PATH Some local variable was blocking the global variable. --- src/sdl/SDL.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdl/SDL.cpp b/src/sdl/SDL.cpp index ef3ac344..3e6d0f33 100644 --- a/src/sdl/SDL.cpp +++ b/src/sdl/SDL.cpp @@ -384,10 +384,10 @@ FILE* sdlFindFile(const char* name) } #ifdef _WIN32 - char* home = getenv("USERPROFILE"); - if (home != NULL) { - fprintf(stdout, "Searching user profile directory: %s\n", home); - sprintf(path, "%s%c%s", home, FILE_SEP, name); + char* profileDir = getenv("USERPROFILE"); + if (profileDir != NULL) { + fprintf(stdout, "Searching user profile directory: %s\n", profileDir); + sprintf(path, "%s%c%s", profileDir, FILE_SEP, name); f = fopen(path, "r"); if (f != NULL) return f;