Browse Source

ENH: handle empty variables

Bill Hoffman 19 years ago
parent
commit
51a84aaa57
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Source/cmCommandArgumentParserHelper.cxx

+ 4 - 0
Source/cmCommandArgumentParserHelper.cxx

@@ -91,6 +91,10 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, cons
 
 char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
 {
+  if(!var)
+    {
+    return 0;
+    }
   if(this->FileName && strcmp(var, "CMAKE_CURRENT_LIST_FILE") == 0)
     {
     return this->AddString(this->FileName);