Skip to content

Commit

Permalink
Improved the check to see if a file is in the user's home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Mar 17, 2018
1 parent d833682 commit df5af12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/stratagus/iolib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,11 @@ static void LibraryFileName(const char *file, char(&buffer)[PATH_MAX])
}
}

snprintf(buffer, PATH_MAX, "%s/%s", Parameters::Instance.GetUserDirectory().c_str(), file);
if (FindFileWithExtension(buffer)) {
return;
}

// In global shared directory
snprintf(buffer, PATH_MAX, "%s/%s", StratagusLibPath.c_str(), file);
if (FindFileWithExtension(buffer)) {
Expand Down

0 comments on commit df5af12

Please sign in to comment.