Tcl Source Code

Artifact [a15bdf3aaa]
Login

Artifact a15bdf3aaa07d89116cc5527b1e291d95df163c0:

Attachment "848262.patch" to ticket [848262ffff] added by dgp 2003-11-25 02:01:09.
Index: generic/tclParse.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclParse.c,v
retrieving revision 1.30
diff -u -r1.30 tclParse.c
--- generic/tclParse.c	15 Nov 2003 03:19:17 -0000	1.30
+++ generic/tclParse.c	24 Nov 2003 18:57:24 -0000
@@ -360,7 +360,9 @@
 		    && (0 == strncmp(expPfx,expPtr->start,expPfxLen))
 					/* Is the prefix */
 		    && (numBytes > 0)
-		    && (0 == TclParseWhiteSpace(termPtr, 1, parsePtr, &type))
+		    && (TclParseWhiteSpace(termPtr, numBytes, parsePtr, &type)
+			    == 0)
+		    && (type != TYPE_COMMAND_END)
 					/* Non-whitespace follows */
 		    ) {
 		expandWord = 1;
Index: tests/parse.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/parse.test,v
retrieving revision 1.17
diff -u -r1.17 parse.test
--- tests/parse.test	14 Nov 2003 20:44:46 -0000	1.17
+++ tests/parse.test	24 Nov 2003 18:57:25 -0000
@@ -215,6 +215,17 @@
 test parse-5.24 {Tcl_ParseCommand: {expand} parsing} testparser {
     testparser {{expand}x} 0
 } {- {{expand}x} 1 expand {{expand}x} 1 text x 0 {}}
+test parse-5.25 {Tcl_ParseCommand: {expand} parsing} testparser {
+    testparser {{expand}
+} 0
+} {- {{expand}
+} 1 simple {{expand}} 1 text expand 0 {}}
+test parse-5.26 {Tcl_ParseCommand: {expand} parsing} testparser {
+    testparser {{expand};} 0
+} {- {{expand};} 1 simple {{expand}} 1 text expand 0 {}}
+test parse-5.27 {Tcl_ParseCommand: {expand} parsing} testparser {
+    testparser "{expand}\\\n foo bar" 0
+} {- \{expand\}\\\n\ foo\ bar 3 simple {{expand}} 1 text expand 0 simple foo 1 text foo 0 simple bar 1 text bar 0 {}}
 
 test parse-6.1 {ParseTokens procedure, empty word} testparser {
     testparser {""} 0