Skip to content

Commit 950ecf8

Browse files
committed
fix issue when TERM is not set in environment
1 parent d42a909 commit 950ecf8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/gtest_mpi/gtest_mpi_internal.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ void PrintFullTestCommentIfPresent(const ::testing::TestInfo &test_info) {
112112
}
113113
}
114114

115-
bool CStringEquals(const char *l, const char *r) { return std::strcmp(l, r) == 0; }
115+
bool CStringEquals(const char *l, const char *r) {
116+
if (l == nullptr) return r == nullptr;
117+
if (r == nullptr) return false;
118+
return std::strcmp(l, r) == 0;
119+
}
116120

117121
bool CaseInsensitiveCStringEquals(const char *l, const char *r) {
118122
bool equal = true;

0 commit comments

Comments
 (0)