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

@ -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);