Fix copy/paste typo causing crash getting tempdirs if an env var had no value

This commit is contained in:
Henrik Rydgård 2021-01-10 20:33:17 +01:00
parent 3b40d47313
commit 6d0315eaf9
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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