We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f4cf16 commit 71b0b4eCopy full SHA for 71b0b4e
1 file changed
src/google/protobuf/compiler/mock_code_generator.cc
@@ -72,7 +72,13 @@ static constexpr absl::string_view kSecondInsertionPoint =
72
" # @@protoc_insertion_point(second_mock_insertion_point) is here\n";
73
74
MockCodeGenerator::MockCodeGenerator(absl::string_view name) : name_(name) {
75
- absl::string_view key = getenv("TEST_CASE");
+ const char* c_key = getenv("TEST_CASE");
76
+ if (c_key == NULL) {
77
+ // In Windows, setting 'TEST_CASE=' is equivalent to unsetting
78
+ // and therefore c_key can be NULL
79
+ c_key = "";
80
+ }
81
+ absl::string_view key(c_key);
82
if (key == "no_editions") {
83
suppressed_features_ |= CodeGenerator::FEATURE_SUPPORTS_EDITIONS;
84
} else if (key == "invalid_features") {
0 commit comments