From 2e1d167bcf3f715cb70c6bea87eb3dbb6c28bdb3 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 8 Apr 2003 22:59:33 +0000 Subject: Use correct test for the empty string in Tcl_ErrorObjCmd --- ChangeLog | 7 +++++++ generic/tclCmdAH.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index adb47fa..7b16c1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-04-08 Donal K. Fellows + + * generic/tclCmdAH.c (Tcl_ErrorObjCmd): Strings are only empty if + they have zero length, not if their first byte is zero, so fix + test guarding Tcl_AddObjErrorInfo to take this into account. [Bug + reported by Don Porter; no bug-id.] + 2003-04-07 Don Porter * generic/tclCompCmds.c (TclCompileIfCmd): Corrected string limits of diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 596cab0..0d15bde 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.27.2.3 2003/03/14 23:19:45 dkf Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.27.2.4 2003/04/08 22:59:36 dkf Exp $ */ #include "tclInt.h" @@ -559,7 +559,7 @@ Tcl_ErrorObjCmd(dummy, interp, objc, objv) if (objc >= 3) { /* process the optional info argument */ info = Tcl_GetStringFromObj(objv[2], &infoLen); - if (*info != 0) { + if (infoLen > 0) { Tcl_AddObjErrorInfo(interp, info, infoLen); iPtr->flags |= ERR_ALREADY_LOGGED; } -- cgit v0.12