summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-02-15 18:02:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-02-15 18:02:00 (GMT)
commit2d54b6822452d67937fbcd365c9af9041f9f99f1 (patch)
tree98a72c4535c7061b39e3c71f17ddc20cc48e1f4e
parentcce4368acee1315cdc42e9d8c5db59a8f479edf7 (diff)
downloadtcl-2d54b6822452d67937fbcd365c9af9041f9f99f1.zip
tcl-2d54b6822452d67937fbcd365c9af9041f9f99f1.tar.gz
tcl-2d54b6822452d67937fbcd365c9af9041f9f99f1.tar.bz2
Distingish between boolean and int when checking whether a boolean is true or not: The internal representation might be either long or wideInt.
-rw-r--r--generic/tclCmdMZ.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 7f38eca..a11e693 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -1572,11 +1572,11 @@ StringIsCmd(
string1 = TclGetStringFromObj(objPtr, &length1);
result = length1 == 0;
}
- } else if (((index == STR_IS_TRUE) &&
- objPtr->internalRep.longValue == 0)
- || ((index == STR_IS_FALSE) &&
- objPtr->internalRep.longValue != 0)) {
- result = 0;
+ } else if (index != STR_IS_BOOL) {
+ TclGetBooleanFromObj(NULL, objPtr, &i);
+ if ((index == STR_IS_TRUE) ^ i) {
+ result = 0;
+ }
}
break;
case STR_IS_CONTROL: