summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2015-07-18 02:39:02 (GMT)
committerdgp@users.sourceforge.net <dgp>2015-07-18 02:39:02 (GMT)
commitbfe447b275b01e76457345d9ddda1489d08547ab (patch)
tree49edfdcfdb0dbe577d7d3921d360c33bc24d0402
parentdee9a9cbe77ea21d498f9c6c3885df0a93c8da50 (diff)
parentb8696be0c025598a01534112c3e65087e7d5f3ce (diff)
downloadtcl-bfe447b275b01e76457345d9ddda1489d08547ab.zip
tcl-bfe447b275b01e76457345d9ddda1489d08547ab.tar.gz
tcl-bfe447b275b01e76457345d9ddda1489d08547ab.tar.bz2
merge trunk
-rw-r--r--generic/tclCompCmdsSZ.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 382d2d1..5d3ffd3 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -3575,16 +3575,16 @@ TclCompileUnsetCmd(
}
return TCL_ERROR;
}
- if (i == 1) {
+ if (varCount == 0) {
const char *bytes;
int len;
bytes = Tcl_GetStringFromObj(leadingWord, &len);
- if (len == 11 && !strncmp("-nocomplain", bytes, 11)) {
+ if (i == 1 && len == 11 && !strncmp("-nocomplain", bytes, 11)) {
flags = 0;
- haveFlags = 1;
- } else if (len == 2 && !strncmp("--", bytes, 2)) {
- haveFlags = 1;
+ haveFlags++;
+ } else if (i == (2 - flags) && len == 2 && !strncmp("--", bytes, 2)) {
+ haveFlags++;
} else {
varCount++;
}
@@ -3599,7 +3599,7 @@ TclCompileUnsetCmd(
*/
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
- if (haveFlags) {
+ for (i=0; i<haveFlags;i++) {
varTokenPtr = TokenAfter(varTokenPtr);
}
for (i=1+haveFlags ; i<parsePtr->numWords ; i++) {