summaryrefslogtreecommitdiffstats
path: root/generic/tclIndexObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIndexObj.c')
-rw-r--r--generic/tclIndexObj.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 5acb6c5..eedb259 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.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: tclIndexObj.c,v 1.3 1999/04/16 00:46:47 stanton Exp $
+ * RCS: @(#) $Id: tclIndexObj.c,v 1.4 1999/06/28 23:49:31 redman Exp $
*/
#include "tclInt.h"
@@ -173,6 +173,15 @@ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags,
key = Tcl_GetStringFromObj(objPtr, &length);
index = -1;
numAbbrev = 0;
+
+ /*
+ * The key should not be empty, otherwise it's not a match.
+ */
+
+ if (key[0] == '\0') {
+ goto error;
+ }
+
for (entryPtr = tablePtr, i = 0; *entryPtr != NULL;
entryPtr = (char **) ((long) entryPtr + offset), i++) {
for (p1 = key, p2 = *entryPtr; *p1 == *p2; p1++, p2++) {