From 2d54b6822452d67937fbcd365c9af9041f9f99f1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 15 Feb 2018 18:02:00 +0000 Subject: Distingish between boolean and int when checking whether a boolean is true or not: The internal representation might be either long or wideInt. --- generic/tclCmdMZ.c | 10 +++++----- 1 file 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: -- cgit v0.12