summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2005-04-09 11:09:50 (GMT)
committerdas <das>2005-04-09 11:09:50 (GMT)
commit451ef00cc599a1b58cf570fdb088f04b0ed63fa1 (patch)
tree0808adabfdc4b120377f27d6103eb9f82bd39950
parent69507a78a66b82d697d2c1467ed537679af0b84b (diff)
downloadtcl-451ef00cc599a1b58cf570fdb088f04b0ed63fa1.zip
tcl-451ef00cc599a1b58cf570fdb088f04b0ed63fa1.tar.gz
tcl-451ef00cc599a1b58cf570fdb088f04b0ed63fa1.tar.bz2
* generic/tclListObj.c (Tcl_ListObjIndex): added missing NULL return
when getting index from an empty list.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclListObj.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 53e2962..1264f5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2005-04-09 Daniel Steffen <das@users.sourceforge.net>
+ * generic/tclListObj.c (Tcl_ListObjIndex): added missing NULL return
+ when getting index from an empty list.
+
* unix/tcl.m4 (Darwin): added -single_module linker flag to
TCL_SHLIB_LD_EXTRAS and TK_SHLIB_LD_EXTRAS.
* unix/configure: autoconf-2.59
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index ddcb062..47bcccf 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.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: tclListObj.c,v 1.21 2005/04/02 02:08:59 msofer Exp $
+ * RCS: @(#) $Id: tclListObj.c,v 1.22 2005/04/09 11:09:58 das Exp $
*/
#include "tclInt.h"
@@ -622,7 +622,8 @@ Tcl_ListObjIndex(interp, listPtr, index, objPtrPtr)
(void) Tcl_GetStringFromObj(listPtr, &length);
if (!length) {
- return 0;
+ *objPtrPtr = NULL;
+ return TCL_OK;
}
result = SetListFromAny(interp, listPtr);