From c94c76084840f5d1725f9994a145c4b891912b5d Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 12 Mar 2003 17:52:36 +0000 Subject: * generic/tclInterp.c (Tcl_InterpObjCmd): Corrected option parsing beyond objc for [interp create --]. Thanks to Marco Maggi. [Bug 702383] --- ChangeLog | 6 ++++++ generic/tclInterp.c | 6 ++++-- tests/interp.test | 7 +++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ccdf6c9..842f527 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-03-12 Don Porter + + * generic/tclInterp.c (Tcl_InterpObjCmd): Corrected option + parsing beyond objc for [interp create --]. Thanks to + Marco Maggi. [Bug 702383] + 2003-03-11 Kevin Kenny * win/makefile.vc: Added two missing uses of $(DBGX) so that diff --git a/generic/tclInterp.c b/generic/tclInterp.c index c0af431..b8f1fe2 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInterp.c,v 1.20 2002/11/27 02:54:00 hobbs Exp $ + * RCS: @(#) $Id: tclInterp.c,v 1.21 2003/03/12 17:52:36 dgp Exp $ */ #include "tclInt.h" @@ -461,7 +461,9 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) Tcl_WrongNumArgs(interp, 2, objv, "?-safe? ?--? ?path?"); return TCL_ERROR; } - slavePtr = objv[i]; + if (i < objc) { + slavePtr = objv[i]; + } } buf[0] = '\0'; if (slavePtr == NULL) { diff --git a/tests/interp.test b/tests/interp.test index 0af4cfc..43599b8 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -10,10 +10,10 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: interp.test,v 1.19 2003/02/05 20:05:47 mdejong Exp $ +# RCS: @(#) $Id: interp.test,v 1.20 2003/03/12 17:52:36 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2.1 namespace import -force ::tcltest::* } @@ -118,6 +118,9 @@ test interp-2.12 {anonymous interps vs existing procs} { regexp "interp(\[0-9]+)" $x dummy anothernum expr $anothernum - $thenum } 1 +test interp-2.13 {correct default when no $path arg is given} -body { + interp create -- +} -match regexp -result {interp[0-9]+} foreach i [interp slaves] { interp delete $i -- cgit v0.12