diff options
author | dgp <dgp@noemail.net> | 2011-05-02 20:13:20 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-05-02 20:13:20 (GMT) |
commit | 49284e27b4d8cdd7030d4355a6c1913bc9051209 (patch) | |
tree | 1359629d1145220aa313147065ecc562f2675afb /generic | |
parent | 47f60f00200a2ff7de5ccf99fb5022896f02c359 (diff) | |
parent | 6f180594f549428ddea3be496026ecc938c99ad4 (diff) | |
download | tcl-49284e27b4d8cdd7030d4355a6c1913bc9051209.zip tcl-49284e27b4d8cdd7030d4355a6c1913bc9051209.tar.gz tcl-49284e27b4d8cdd7030d4355a6c1913bc9051209.tar.bz2 |
Tests for expanded literals quoting detection.
FossilOrigin-Name: 8e716527445883b929b6170c90c2722a0d0a6c46
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclParse.c | 8 |
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; |