summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-07-18 01:45:06 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-07-18 01:45:06 (GMT)
commitc4bd26e0547476f6e3d4ac8e09f312694425518d (patch)
treefe4efa6af7024763e0aa323acd7247237baf093f /generic
parent67b1d52de2318caeaf6a6d137467a3c12f0807ec (diff)
downloadtcl-c4bd26e0547476f6e3d4ac8e09f312694425518d.zip
tcl-c4bd26e0547476f6e3d4ac8e09f312694425518d.tar.gz
tcl-c4bd26e0547476f6e3d4ac8e09f312694425518d.tar.bz2
Fix failing test
Diffstat (limited to 'generic')
-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++) {