diff options
-rw-r--r-- | jim.c | 4 | ||||
-rw-r--r-- | regtest.tcl | 6 |
2 files changed, 10 insertions, 0 deletions
@@ -12292,6 +12292,10 @@ static int Jim_LsearchCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const * } } + argc -= i; + if (argc < 2) { + goto wrongargs; + } argv += i; if (opt_all) { diff --git a/regtest.tcl b/regtest.tcl index a46b849..14ce59f 100644 --- a/regtest.tcl +++ b/regtest.tcl @@ -350,6 +350,12 @@ puts "TEST 50 PASSED" catch {expr {2 && "abc$"}} puts "TEST 51 PASSED" +# REGTEST 52 +# lsearch -command with too few args +catch {lsearch -all -command abc def} +puts "TEST 52 PASSED" + + # TAKE THE FOLLOWING puts AS LAST LINE puts "--- ALL TESTS PASSED ---" |