diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2003-02-27 16:01:46 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2003-02-27 16:01:46 (GMT) |
commit | c1eba82515c8db80a9098d7325d5940c203264e7 (patch) | |
tree | befea6f4d22586dd3a2966059d784f1154032975 /generic/tclCmdIL.c | |
parent | 4873c79487937794dde949506edacf8e5372b9f0 (diff) | |
download | tcl-c1eba82515c8db80a9098d7325d5940c203264e7.zip tcl-c1eba82515c8db80a9098d7325d5940c203264e7.tar.gz tcl-c1eba82515c8db80a9098d7325d5940c203264e7.tar.bz2 |
Stop [lsearch -start 0 {} x] from crashing. [Bug #694232]
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r-- | generic/tclCmdIL.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 4bbe241..2c77649 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdIL.c,v 1.46 2003/02/11 23:59:39 hobbs Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.47 2003/02/27 16:01:55 dkf Exp $ */ #include "tclInt.h" @@ -2928,10 +2928,11 @@ Tcl_LsearchObjCmd(clientData, interp, objc, objv) if (result != TCL_OK) { return result; } + if (offset > listc-1) { + offset = listc-1; + } if (offset < 0) { offset = 0; - } else if (offset > listc-1) { - offset = listc-1; } } |