summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-05-14 08:57:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-05-14 08:57:26 (GMT)
commit4b44b131e1861cfca2b4de299e4b64218efefa10 (patch)
tree1146b72baa96e51760dd2a93cdd4a6c09b080be0 /generic/tclCmdMZ.c
parentd26e64c0ba3b4f316034112f270a073472543cae (diff)
downloadtcl-4b44b131e1861cfca2b4de299e4b64218efefa10.zip
tcl-4b44b131e1861cfca2b4de299e4b64218efefa10.tar.gz
tcl-4b44b131e1861cfca2b4de299e4b64218efefa10.tar.bz2
Negative start index to [string first] caused offset return value (Bug 423581)
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 54c1878..6d6939e 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.36 2001/04/24 20:59:17 kennykb Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.37 2001/05/14 08:57:26 dkf Exp $
*/
#include "tclInt.h"
@@ -1267,6 +1267,12 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
} else if (start > 0) {
ustring2 += start;
length2 -= start;
+ } else if (start < 0) {
+ /*
+ * Invalid start index mapped to string start;
+ * Bug #423581
+ */
+ start = 0;
}
}