summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandArgumentParserHelper.cxx
diff options
context:
space:
mode:
authorDāvis Mosāns <davispuh@gmail.com>2016-07-07 21:54:05 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-18 13:51:01 (GMT)
commitb1f87a50b3aee129d420b8d789ebec55068e4ec5 (patch)
treee9223617c45d01c60a4c89c5d60dc0121a75a989 /Source/cmCommandArgumentParserHelper.cxx
parent03407040d4d7d89fbb45e941a9dfb4257003a8a8 (diff)
downloadCMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.zip
CMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.tar.gz
CMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.tar.bz2
Use better KWSys SystemTools::GetEnv and HasEnv signatures
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx8
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;