Skip to content

Commit

Permalink
Update io_win32_unittest.cc
Browse files Browse the repository at this point in the history
Fix the same issue mentioned in protocolbuffers#3533
  • Loading branch information
ybsave authored Oct 18, 2017
1 parent c4f59dc commit 7861ae5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/google/protobuf/stubs/io_win32_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ void IoWin32Test::SetUp() {
// Only Bazel defines TEST_TMPDIR, CMake does not, so look for other
// suitable environment variables.
if (test_tmpdir.empty()) {
for (const char* name : {"TEMP", "TMP"}) {
test_tmpdir_env = getenv(name);
const char * kNameList[] = {"TEMP", "TMP"};
for (int i = 0; i < 2; ++i) {
test_tmpdir_env = getenv(kNameList[i]);
if (test_tmpdir_env != nullptr && *test_tmpdir_env) {
test_tmpdir = string(test_tmpdir_env);
break;
Expand Down

0 comments on commit 7861ae5

Please sign in to comment.