Skip to content

Commit

Permalink
Fix copy/paste typo causing crash getting tempdirs if an env var had …
Browse files Browse the repository at this point in the history
…no value
  • Loading branch information
hrydgard committed Jan 10, 2021
1 parent 3b40d47 commit 6d0315e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Qt/QtMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ std::vector<std::string> System_GetPropertyStringVec(SystemProperty prop) {
case SYSPROP_TEMP_DIRS:
if (getenv("TMPDIR") && strlen(getenv("TMPDIR")) != 0)
result.push_back(getenv("TMPDIR"));
if (getenv("TMPDIR") && strlen(getenv("TMP")) != 0)
if (getenv("TMP") && strlen(getenv("TMP")) != 0)
result.push_back(getenv("TMP"));
if (getenv("TMPDIR") && strlen(getenv("TEMP")) != 0)
if (getenv("TEMP") && strlen(getenv("TEMP")) != 0)
result.push_back(getenv("TEMP"));
return result;

Expand Down
4 changes: 2 additions & 2 deletions SDL/SDLMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ std::vector<std::string> System_GetPropertyStringVec(SystemProperty prop) {
case SYSPROP_TEMP_DIRS:
if (getenv("TMPDIR") && strlen(getenv("TMPDIR")) != 0)
result.push_back(getenv("TMPDIR"));
if (getenv("TMPDIR") && strlen(getenv("TMP")) != 0)
if (getenv("TMP") && strlen(getenv("TMP")) != 0)
result.push_back(getenv("TMP"));
if (getenv("TMPDIR") && strlen(getenv("TEMP")) != 0)
if (getenv("TEMP") && strlen(getenv("TEMP")) != 0)
result.push_back(getenv("TEMP"));
return result;

Expand Down
4 changes: 2 additions & 2 deletions UWP/PPSSPP_UWPMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ std::vector<std::string> System_GetPropertyStringVec(SystemProperty prop) {

if (getenv("TMPDIR") && strlen(getenv("TMPDIR")) != 0)
result.push_back(getenv("TMPDIR"));
if (getenv("TMPDIR") && strlen(getenv("TMP")) != 0)
if (getenv("TMP") && strlen(getenv("TMP")) != 0)
result.push_back(getenv("TMP"));
if (getenv("TMPDIR") && strlen(getenv("TEMP")) != 0)
if (getenv("TEMP") && strlen(getenv("TEMP")) != 0)
result.push_back(getenv("TEMP"));
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions Windows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ std::vector<std::string> System_GetPropertyStringVec(SystemProperty prop) {

if (getenv("TMPDIR") && strlen(getenv("TMPDIR")) != 0)
result.push_back(getenv("TMPDIR"));
if (getenv("TMPDIR") && strlen(getenv("TMP")) != 0)
if (getenv("TMP") && strlen(getenv("TMP")) != 0)
result.push_back(getenv("TMP"));
if (getenv("TMPDIR") && strlen(getenv("TEMP")) != 0)
if (getenv("TEMP") && strlen(getenv("TEMP")) != 0)
result.push_back(getenv("TEMP"));
return result;
}
Expand Down

0 comments on commit 6d0315e

Please sign in to comment.