Skip to content

Commit

Permalink
Ensure slash at end of save location path
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf authored and TellowKrinkle committed Oct 13, 2021
1 parent 066c6a1 commit 08623f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/PonscripterLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,13 @@ pstring Steam_GetSavePath(const pstring& local_savedir) {
}
savelocContent = pstring(pstr_split_first(savelocContent, '\n').first).trim();
if (savelocContent) {
// Make sure there is some kind of slash at the end, otherwise the path will be interpreted as a file instead of a directory
// This only should happen if the saveloc file is edited manually, and the user does not add a slash.
if(!(savelocContent.ends_with("/") || savelocContent.ends_with("\\")))
{
savelocContent += "/";
}

struct stat info;
if (stat(path, &info) != 0 || !S_ISDIR(info.st_mode))
{
Expand Down

0 comments on commit 08623f7

Please sign in to comment.