Fix seg fault for empty ENV{} call bug #9747
This commit is contained in:
parent
7130628312
commit
2f94a2c919
|
@ -66,6 +66,10 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
|
||||||
{
|
{
|
||||||
return this->ExpandVariable(var);
|
return this->ExpandVariable(var);
|
||||||
}
|
}
|
||||||
|
if(!var)
|
||||||
|
{
|
||||||
|
return this->EmptyVariable;
|
||||||
|
}
|
||||||
if ( strcmp(key, "ENV") == 0 )
|
if ( strcmp(key, "ENV") == 0 )
|
||||||
{
|
{
|
||||||
char *ptr = getenv(var);
|
char *ptr = getenv(var);
|
||||||
|
|
Loading…
Reference in New Issue