From 15f0f765a5441cc7e8ad6b05238368f91ed0f8e9 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 17 Oct 2002 17:41:43 +0000 Subject: * generic/tclVar.c: Fixed code that check for proper # of args to * tests/var.test: [array names]. Added test. [Bug 624755] --- ChangeLog | 5 +++++ generic/tclVar.c | 4 ++-- tests/var.test | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index de55558..87b1b1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-10-17 Don Porter + + * generic/tclVar.c: Fixed code that check for proper # of args to + * tests/var.test: [array names]. Added test. [Bug 624755] + 2002-10-16 Jeff Hobbs * win/configure: add workaround for cygwin windres diff --git a/generic/tclVar.c b/generic/tclVar.c index 0143b2f..28684cd 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.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: tclVar.c,v 1.67 2002/09/05 20:21:06 dgp Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.68 2002/10/17 17:41:44 dgp Exp $ */ #include "tclInt.h" @@ -3093,7 +3093,7 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv) mode = OPT_GLOB; - if ((objc < 3) && (objc > 5)) { + if ((objc < 3) || (objc > 5)) { Tcl_WrongNumArgs(interp, 2, objv, "arrayName ?mode? ?pattern?"); return TCL_ERROR; diff --git a/tests/var.test b/tests/var.test index 7955c93..93b44f2 100644 --- a/tests/var.test +++ b/tests/var.test @@ -14,11 +14,11 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: var.test,v 1.19 2002/07/15 22:18:08 msofer Exp $ +# RCS: @(#) $Id: var.test,v 1.20 2002/10/17 17:41:45 dgp Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2.2 namespace import -force ::tcltest::* } @@ -666,6 +666,10 @@ test var-13.1 {Tcl_UnsetVar2, unset array with trace set on element} { set x "If you see this, it worked" } "If you see this, it worked" +test var-14.1 {array names syntax} -body { + array names foo bar baz snafu +} -returnCodes 1 -match glob -result * + catch {namespace delete ns} catch {unset arr} catch {unset v} -- cgit v0.12