Fix a bug in command-line escaping. (Jan Nieuwenhuizen)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 5 Nov 2005 23:14:01 +0000 (23:14 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 5 Nov 2005 23:14:01 +0000 (23:14 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1378 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Subst.py
src/engine/SCons/SubstTests.py

index 38a04767fb679cfe61b17387bf8d6b8c981dda0d..f65e06183c333d95fc8d2531facf03e7181b1f16 100644 (file)
@@ -449,6 +449,10 @@ RELEASE 0.97 - XXX
     value directory; avoiding slowing substitution logic when there's no
     '$' in the string.
 
+  From Jan Nieuwenhuizen:
+
+  - Fix a problem with interpreting quoted argument lists on command lines.
+
   From Greg Noel:
 
   - Add construction variables to support frameworks on Mac OS X:
@@ -706,6 +710,13 @@ RELEASE 0.97 - XXX
 
   - Update EnsureSConsVersion() to support revision numbers.
 
+  From Dobes Vandermeer:
+
+  - Add support for SCC and other settings in Microsoft Visual
+    Studio project and solution files:  $MSVS_PROJECT_BASE_PATH,
+    $MSVS_PROJECT_GUID, $MSVS_SCC_AUX_PATH, $MSVS_SCC_LOCAL_PATH,
+    $MSVS_SCC_PROJECT_NAME, $MSVS_SCC_PROVIDER,
+
   From Greg Ward:
 
   - Fix a misplaced line in the man page.
index 47674039fef3f54963bca1530175a3f96a762a62..56522a13ff779d59d9a11c0c1029ec91e7c37052 100644 (file)
@@ -708,11 +708,21 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gv
                         self.add_new_word(x)
                     else:
                         y = current_word + x
-                        literal1 = self.literal(self[-1][-1])
-                        literal2 = self.literal(x)
+
+                        # We used to treat a word appended to a literal
+                        # as a literal itself, but this caused problems
+                        # with interpreting quotes around space-separated
+                        # targets on command lines.  Removing this makes
+                        # none of the "substantive" end-to-end tests fail,
+                        # so we'll take this out but leave it commented
+                        # for now in case there's a problem not covered
+                        # by the test cases and we need to resurrect this.
+                        #literal1 = self.literal(self[-1][-1])
+                        #literal2 = self.literal(x)
                         y = self.conv(y)
                         if is_String(y):
-                            y = CmdStringHolder(y, literal1 or literal2)
+                            #y = CmdStringHolder(y, literal1 or literal2)
+                            y = CmdStringHolder(y, None)
                         self[-1][-1] = y
 
         def add_new_word(self, x):
index 64a2fe5af448a1bb53e4f497a879e606381a4d16..8a56f674a2ca9db090fca4480826f0477bd5e371 100644 (file)
@@ -818,11 +818,26 @@ class SubstTestCase(unittest.TestCase):
         c = cmd_list[0][3].escape(escape_func)
         assert c == 'xyz', c
 
+        # We used to treat literals smooshed together like the whole
+        # thing was literal and escape it as a unit.  The commented-out
+        # asserts below are in case we ever have to find a way to
+        # resurrect that functionality in some way.
         cmd_list = scons_subst_list("abc${LITERALS}xyz", env, gvars=gvars)
         c = cmd_list[0][0].escape(escape_func)
-        assert c == '**abcfoo\nwith\nnewlines**', c
+        #assert c == '**abcfoo\nwith\nnewlines**', c
+        assert c == 'abcfoo\nwith\nnewlines', c
         c = cmd_list[0][1].escape(escape_func)
-        assert c == '**bar\nwith\nnewlinesxyz**', c
+        #assert c == '**bar\nwith\nnewlinesxyz**', c
+        assert c == 'bar\nwith\nnewlinesxyz', c
+
+        cmd_list = scons_subst_list('echo "target: $TARGET"', env,
+                                    target=_t, gvars=gvars)
+        c = cmd_list[0][0].escape(escape_func)
+        assert c == 'echo', c
+        c = cmd_list[0][1].escape(escape_func)
+        assert c == '"target:', c
+        c = cmd_list[0][2].escape(escape_func)
+        assert c == 't"', c
 
         # Tests of the various SUBST_* modes of substitution.
         subst_list_cases = [