From 2f94a2c919ddb39f33c47b4baa7bd37e2ae4cacd Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 21 Oct 2009 09:04:50 -0400 Subject: Fix seg fault for empty ENV{} call bug #9747 --- Source/cmCommandArgumentParserHelper.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index ace67ec..234c37e 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -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); -- cgit v0.12