Browse Source

BUG: Double-quotes in definitions must be escaped.

Brad King 20 years ago
parent
commit
b9e088dcfa
1 changed files with 5 additions and 2 deletions
  1. 5 2
      Source/cmLocalVisualStudio7Generator.cxx

+ 5 - 2
Source/cmLocalVisualStudio7Generator.cxx

@@ -946,8 +946,11 @@ void cmLocalVisualStudio7Generator::OutputDefineFlags(const char* flags,
       done = true;
       }
 
-    cmSystemTools::ReplaceString(define, "\"", """);
-    fout << define << ",";
+    // Double-quotes in the value of the definition must be escaped
+    // with a backslash.  The entire definition should be quoted in
+    // the generated xml attribute to avoid confusing the VS parser.
+    cmSystemTools::ReplaceString(define, "\"", "\\&quot;");
+    fout << "&quot;" << define << "&quot;,";
     if(!done)
       {
       pos = defs.find("-D", nextpos);