diff options
author | dgp <dgp@users.sourceforge.net> | 2011-05-02 20:10:00 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-05-02 20:10:00 (GMT) |
commit | 4f558942fb97b0dd3652ee2a257fe94b1dc3a8db (patch) | |
tree | a52dbc4a8914a59243eb5871aa40958b6f8f5ccc /generic/tclParse.c | |
parent | 58a04d6f1325fc9905ccac80234f9fc0d92b0318 (diff) | |
download | tcl-4f558942fb97b0dd3652ee2a257fe94b1dc3a8db.zip tcl-4f558942fb97b0dd3652ee2a257fe94b1dc3a8db.tar.gz tcl-4f558942fb97b0dd3652ee2a257fe94b1dc3a8db.tar.bz2 |
Tests for expanded literals quoting detection.
Diffstat (limited to 'generic/tclParse.c')
-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; |