Fix seg fault for empty ENV{} call bug #9747

This commit is contained in:
Bill Hoffman 2009-10-21 09:04:50 -04:00
parent 7130628312
commit 2f94a2c919
1 changed files with 5 additions and 1 deletions

View File

@ -65,7 +65,11 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
if ( !key )
{
return this->ExpandVariable(var);
}
}
if(!var)
{
return this->EmptyVariable;
}
if ( strcmp(key, "ENV") == 0 )
{
char *ptr = getenv(var);