SDL: Fix Windows build never searching PATH

Some local variable was blocking the global variable.
This commit is contained in:
Clownacy 2020-12-14 20:46:45 +00:00 committed by Rafael Kitover
parent 2a237aea6b
commit d464bc4dfe
1 changed files with 4 additions and 4 deletions

View File

@ -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;