diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-03-24 21:54:10 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-03-24 21:54:10 (GMT) |
commit | 658bfb282ce6fcba3cdf53d7448e7fa3e3fa05ac (patch) | |
tree | 12d7260cfbaa9c980ef4a74ae6c7798f7bb968cc | |
parent | 82535bcc54c1cbe004c83beec30fc0cc27772fc2 (diff) | |
download | tcl-658bfb282ce6fcba3cdf53d7448e7fa3e3fa05ac.zip tcl-658bfb282ce6fcba3cdf53d7448e7fa3e3fa05ac.tar.gz tcl-658bfb282ce6fcba3cdf53d7448e7fa3e3fa05ac.tar.bz2 |
Silly bug found originally by Damon Courtney. [922752]
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclNamesp.c | 4 | ||||
-rw-r--r-- | tests/namespace.test | 9 |
3 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2004-03-24 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tclNamesp.c (NsEnsembleImplementationCmd): Fix messed up + handling of strncmp result which just happened to work in some + libc implementations. [Bug 922752] + 2004-03-23 Donal K. Fellows <donal.k.fellows@man.ac.uk> * doc/StringObj.3: Inverted the sense of the documentation of how diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index a4c4f2e..ded1f96 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -21,7 +21,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNamesp.c,v 1.36 2004/03/18 18:54:58 rmax Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.37 2004/03/24 21:54:32 dkf Exp $ */ #include "tclInt.h" @@ -4880,7 +4880,7 @@ NsEnsembleImplementationCmd(clientData, interp, objc, objv) goto unknownOrAmbiguousSubcommand; } fullName = ensemblePtr->subcommandArrayPtr[i]; - } else if (cmp == 1) { + } else if (cmp < 0) { /* * Because we are searching a sorted table, we can now * stop searching because we have gone past anything diff --git a/tests/namespace.test b/tests/namespace.test index 72a2f33..4eb2854 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: namespace.test,v 1.23 2003/11/14 20:44:46 dgp Exp $ +# RCS: @(#) $Id: namespace.test,v 1.24 2004/03/24 21:54:32 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -1389,6 +1389,13 @@ test namespace-44.4 {ensemble: errors} { list [catch {namespace ensemble create -map {x {}}} msg] $msg } } {1 {ensemble subcommand implementations must be non-empty lists}} +test namespace-44.5 {ensemble: errors} -setup { + namespace ensemble create -command foobar -subcommands {foobarcget foobarconfigure} +} -body { + foobar foobarcon +} -cleanup { + rename foobar {} +} -returnCodes error -result {invalid command name "::foobarconfigure"} test namespace-45.1 {ensemble: introspection} { namespace eval ns { |