diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2000-11-24 15:29:51 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2000-11-24 15:29:51 (GMT) |
commit | fc5ae1303256736570c487af3878721224de2afc (patch) | |
tree | 4fc9bfe9d0af05ee99a1fbf3dcf4e0704debc7fa /generic | |
parent | 4cf6a38e55fbdf502fcbb4d15c8ad94e4f891e6d (diff) | |
download | tcl-fc5ae1303256736570c487af3878721224de2afc.zip tcl-fc5ae1303256736570c487af3878721224de2afc.tar.gz tcl-fc5ae1303256736570c487af3878721224de2afc.tar.bz2 |
Logical negation "!" can now handle string booleans, provided those
values are placed in variables. Resolves bug #119153 as most people
will experience it.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index e9e3ebb..cdc0724 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.15 2000/09/06 16:59:27 hobbs Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.16 2000/11/24 15:29:51 dkf Exp $ */ #include "tclInt.h" @@ -2512,6 +2512,7 @@ TclExecuteByteCode(interp, codePtr) */ double d; + int boolvar; Tcl_ObjType *tPtr; valuePtr = POP_OBJECT(); @@ -2530,6 +2531,11 @@ TclExecuteByteCode(interp, codePtr) result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, valuePtr, &d); } + if (result == TCL_ERROR && *pc == INST_LNOT) { + result = Tcl_GetBooleanFromObj((Tcl_Interp *)NULL, + valuePtr, &boolvar); + i = (long)boolvar; /* i is long, not int! */ + } if (result != TCL_OK) { TRACE(("\"%.20s\" => ILLEGAL TYPE %s\n", s, (tPtr? tPtr->name : "null"))); |