summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2011-05-02 20:13:20 (GMT)
committerdgp@users.sourceforge.net <dgp>2011-05-02 20:13:20 (GMT)
commit02b10462cb6d0e701d9741f8ec8f7007c8de3ed2 (patch)
tree1359629d1145220aa313147065ecc562f2675afb /generic/tclParse.c
parent5847379761c62b5e7513c631c0851996dad07d94 (diff)
parent8a31899fefcffee9dd7f85c6b326ac7550d373af (diff)
downloadtcl-02b10462cb6d0e701d9741f8ec8f7007c8de3ed2.zip
tcl-02b10462cb6d0e701d9741f8ec8f7007c8de3ed2.tar.gz
tcl-02b10462cb6d0e701d9741f8ec8f7007c8de3ed2.tar.bz2
Tests for expanded literals quoting detection.
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index c8d2012..96c2a10 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -496,6 +496,7 @@ Tcl_ParseCommand(
* tokens representing the expanded list.
*/
+ CONST char *listStart;
int growthNeeded = wordIndex + 2*elemCount
- parsePtr->numTokens;
parsePtr->numWords += elemCount - 1;
@@ -514,7 +515,7 @@ Tcl_ParseCommand(
* word value.
*/
- nextElem = tokenPtr[1].start;
+ listStart = nextElem = tokenPtr[1].start;
while (nextElem < listEnd) {
int quoted;
@@ -528,8 +529,9 @@ Tcl_ParseCommand(
&(tokenPtr->start), &nextElem,
&(tokenPtr->size), NULL);
- quoted = tokenPtr->start[-1] == '{'
- || tokenPtr->start[-1] == '"';
+ quoted = (tokenPtr->start[-1] == '{'
+ || tokenPtr->start[-1] == '"')
+ && tokenPtr->start > listStart;
tokenPtr[-1].start = tokenPtr->start - quoted;
tokenPtr[-1].size = tokenPtr->start + tokenPtr->size
- tokenPtr[-1].start + quoted;