summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandArgumentParserHelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index a4f3c7d..42fb105 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -25,7 +25,7 @@ cmCommandArgumentParserHelper::cmCommandArgumentParserHelper()
this->WarnUninitialized = false;
this->CheckSystemVars = false;
this->FileLine = -1;
- this->FileName = 0;
+ this->FileName = CM_NULLPTR;
this->RemoveEmpty = true;
this->EmptyVariable[0] = 0;
strcpy(this->DCURLYVariable, "${");
@@ -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;
@@ -96,13 +96,13 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
e << "Syntax $" << key << "{} is not supported. "
<< "Only ${}, $ENV{}, and $CACHE{} are allowed.";
this->SetError(e.str());
- return 0;
+ return CM_NULLPTR;
}
char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
{
if (!var) {
- return 0;
+ return CM_NULLPTR;
}
if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) {
std::ostringstream ostr;
@@ -125,7 +125,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
}
}
- return 0;
+ return CM_NULLPTR;
}
if (this->EscapeQuotes && value) {
return this->AddString(cmSystemTools::EscapeQuotes(value));
@@ -176,7 +176,7 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2)
void cmCommandArgumentParserHelper::AllocateParserType(
cmCommandArgumentParserHelper::ParserType* pt, const char* str, int len)
{
- pt->str = 0;
+ pt->str = CM_NULLPTR;
if (len == 0) {
len = static_cast<int>(strlen(str));
}