summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-04-08 22:55:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-04-08 22:55:06 (GMT)
commite97a7ae6a0efb511feb257bacc4e2daaa8e20a92 (patch)
treeda34ff450686f85933e779193b3009a6ebe6f3b1
parent45bcc347fab6f309d05ba3dfd53c163c993b30e0 (diff)
downloadtcl-e97a7ae6a0efb511feb257bacc4e2daaa8e20a92.zip
tcl-e97a7ae6a0efb511feb257bacc4e2daaa8e20a92.tar.gz
tcl-e97a7ae6a0efb511feb257bacc4e2daaa8e20a92.tar.bz2
Use correct test for the empty string in Tcl_ErrorObjCmd
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclCmdAH.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 69be9bd..ada44e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-04-08 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * 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 <dgp@users.sourceforge.net>
* generic/tclCompCmds.c (TclCompileIfCmd): Corrected string limits of
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index aece00f..25574ad 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.29 2003/03/14 16:28:07 dkf Exp $
+ * RCS: @(#) $Id: tclCmdAH.c,v 1.30 2003/04/08 22:55:09 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;
}