Skip to content

Commit

Permalink
fix issue when TERM is not set in environment
Browse files Browse the repository at this point in the history
  • Loading branch information
AdhocMan committed Mar 26, 2024
1 parent d42a909 commit 950ecf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/gtest_mpi/gtest_mpi_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ void PrintFullTestCommentIfPresent(const ::testing::TestInfo &test_info) {
}
}

bool CStringEquals(const char *l, const char *r) { return std::strcmp(l, r) == 0; }
bool CStringEquals(const char *l, const char *r) {
if (l == nullptr) return r == nullptr;
if (r == nullptr) return false;
return std::strcmp(l, r) == 0;
}

bool CaseInsensitiveCStringEquals(const char *l, const char *r) {
bool equal = true;
Expand Down

0 comments on commit 950ecf8

Please sign in to comment.