[cmake-commits] king committed cmCommandArgumentParser.cxx 1.9 1.10 cmCommandArgumentParser.y 1.9 1.10 cmCommandArgumentParserHelper.cxx 1.16 1.17 cmCommandArgumentParserHelper.h 1.8 1.9 cmMakefile.cxx 1.357 1.358 cmMakefile.h 1.193 1.194

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Oct 4 14:37:45 EDT 2006


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv32241/Source

Modified Files:
	cmCommandArgumentParser.cxx cmCommandArgumentParser.y 
	cmCommandArgumentParserHelper.cxx 
	cmCommandArgumentParserHelper.h cmMakefile.cxx cmMakefile.h 
Log Message:
BUG: Do not replace @VAR@ syntax in list files.  This addresses bug #2722.


Index: cmCommandArgumentParser.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParser.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmCommandArgumentParser.cxx	24 Aug 2006 18:58:22 -0000	1.9
+++ cmCommandArgumentParser.cxx	4 Oct 2006 18:37:41 -0000	1.10
@@ -1320,7 +1320,7 @@
   case 17:
 #line 178 "cmCommandArgumentParser.y"
     {
-  (yyval.str) = yyGetParser->ExpandVariable((yyvsp[0].str));
+  (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str));
 }
     break;
 

Index: cmCommandArgumentParserHelper.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmCommandArgumentParserHelper.h	15 Mar 2006 16:01:59 -0000	1.8
+++ cmCommandArgumentParserHelper.h	4 Oct 2006 18:37:41 -0000	1.9
@@ -59,6 +59,7 @@
 
   char* ExpandSpecialVariable(const char* key, const char* var);
   char* ExpandVariable(const char* var);
+  char* ExpandVariableForAt(const char* var);
   void SetResult(const char* value);
 
   void SetMakefile(const cmMakefile* mf);
@@ -68,6 +69,7 @@
   void SetLineFile(long line, const char* file);
   void SetEscapeQuotes(bool b) { this->EscapeQuotes = b; }
   void SetNoEscapeMode(bool b) { this->NoEscapeMode = b; }
+  void SetReplaceAtSyntax(bool b) { this->ReplaceAtSyntax = b; }
 
   const char* GetError() { return this->ErrorString.c_str(); } 
   char EmptyVariable[1];
@@ -101,6 +103,7 @@
   bool EscapeQuotes;
   std::string ErrorString;
   bool NoEscapeMode;
+  bool ReplaceAtSyntax;
 };
 
 #endif

Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- cmMakefile.h	2 Oct 2006 15:13:57 -0000	1.193
+++ cmMakefile.h	4 Oct 2006 18:37:41 -0000	1.194
@@ -570,7 +570,8 @@
                                       bool atOnly = false,
                                       const char* filename = 0,
                                       long line = -1,
-                                      bool removeEmpty = false) const;
+                                      bool removeEmpty = false,
+                                      bool replaceAt = true) const;
 
   /**
    * Remove any remaining variables in the string. Anything with ${var} or

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.357
retrieving revision 1.358
diff -u -d -r1.357 -r1.358
--- cmMakefile.cxx	2 Oct 2006 15:13:56 -0000	1.357
+++ cmMakefile.cxx	4 Oct 2006 18:37:41 -0000	1.358
@@ -1662,7 +1662,8 @@
                                                 bool atOnly,
                                                 const char* filename,
                                                 long line,
-                                                bool removeEmpty) const
+                                                bool removeEmpty,
+                                                bool replaceAt) const
 {
   if ( source.empty() || source.find_first_of("$@\\") == source.npos)
     {
@@ -1681,6 +1682,7 @@
     parser.SetLineFile(line, filename);
     parser.SetEscapeQuotes(escapeQuotes);
     parser.SetNoEscapeMode(noEscapes);
+    parser.SetReplaceAtSyntax(replaceAt);
     int res = parser.ParseString(source.c_str(), 0);
     if ( res )
       {
@@ -2022,7 +2024,8 @@
     // Expand the variables in the argument.
     value = i->Value;
     this->ExpandVariablesInString(value, false, false, false, 
-                                  i->FilePath, i->Line);
+                                  i->FilePath, i->Line,
+                                  false, false);
 
     // If the argument is quoted, it should be one argument.
     // Otherwise, it may be a list of arguments.

Index: cmCommandArgumentParser.y
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParser.y,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmCommandArgumentParser.y	24 Aug 2006 18:58:22 -0000	1.9
+++ cmCommandArgumentParser.y	4 Oct 2006 18:37:41 -0000	1.10
@@ -193,7 +193,7 @@
 |
 cal_ATNAME
 {
-  $<str>$ = yyGetParser->ExpandVariable($<str>1);
+  $<str>$ = yyGetParser->ExpandVariableForAt($<str>1);
 }
 
 MultipleIds:

Index: cmCommandArgumentParserHelper.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cmCommandArgumentParserHelper.cxx	27 Sep 2006 20:14:16 -0000	1.16
+++ cmCommandArgumentParserHelper.cxx	4 Oct 2006 18:37:41 -0000	1.17
@@ -37,6 +37,7 @@
   strcpy(this->BSLASHVariable, "\\");
 
   this->NoEscapeMode = false;
+  this->ReplaceAtSyntax = false;
 }
 
 
@@ -115,6 +116,21 @@
   return this->AddString(value);
 }
 
+char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
+{
+  if(this->ReplaceAtSyntax)
+    {
+    return this->ExpandVariable(var);
+    }
+  else
+    {
+    std::string ref = "@";
+    ref += var;
+    ref += "@";
+    return this->AddString(ref.c_str());
+    }
+}
+
 char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2)
 {
   if ( !in1 )



More information about the Cmake-commits mailing list