diff options
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r-- | Source/cmCommandArgumentParserHelper.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 294117c..42fb105 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -71,12 +71,12 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, return this->EmptyVariable; } if (strcmp(key, "ENV") == 0) { - char* ptr = getenv(var); - if (ptr) { + std::string str; + if (cmSystemTools::GetEnv(var, str)) { if (this->EscapeQuotes) { - return this->AddString(cmSystemTools::EscapeQuotes(ptr)); + return this->AddString(cmSystemTools::EscapeQuotes(str.c_str())); } else { - return ptr; + return this->AddString(str); } } return this->EmptyVariable; |