summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-07-02 17:21:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-07-02 17:21:53 (GMT)
commita139661621ec842c91242c4b0fca910b9c964398 (patch)
tree642e72b2957bdc240f47bb9d915a52d60995d771
parent445755f38427241613b3d9209d17beab10076743 (diff)
downloadtcl-a139661621ec842c91242c4b0fca910b9c964398.zip
tcl-a139661621ec842c91242c4b0fca910b9c964398.tar.gz
tcl-a139661621ec842c91242c4b0fca910b9c964398.tar.bz2
[f961d7d1dd] Repair usage message for ensemble parameters with spaces.
-rw-r--r--generic/tclEnsemble.c13
-rw-r--r--tests/namespace.test9
2 files changed, 12 insertions, 10 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 5c47ce3..a86b5c4 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -1674,18 +1674,11 @@ NsEnsembleImplementationCmdNR(
*/
Tcl_DString buf; /* Message being built */
- Tcl_Obj **elemPtrs; /* Parameter names */
- int len; /* Number of parameters to append */
Tcl_DStringInit(&buf);
- if (ensemblePtr->parameterList == NULL) {
- len = 0;
- } else if (TclListObjGetElements(NULL, ensemblePtr->parameterList,
- &len, &elemPtrs) != TCL_OK) {
- Tcl_Panic("List of ensemble parameters is not a list");
- }
- for (; len>0; len--,elemPtrs++) {
- TclDStringAppendObj(&buf, *elemPtrs);
+ if (ensemblePtr->parameterList) {
+ Tcl_DStringAppend(&buf,
+ TclGetString(ensemblePtr->parameterList), -1);
TclDStringAppendLiteral(&buf, " ");
}
TclDStringAppendLiteral(&buf, "subcommand ?arg ...?");
diff --git a/tests/namespace.test b/tests/namespace.test
index c433241..dc1d3bf 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -2153,6 +2153,15 @@ test namespace-50.7 {[4402cfa58c]} -setup {
rename e2 {}
rename target {}
} -result {{wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"}}
+test namespace-50.8 {[f961d7d1dd]} -setup {
+ proc target {} {}
+ namespace ensemble create -command e -map {s target} -parameters {{a b}}
+} -body {
+ e
+} -returnCodes error -result {wrong # args: should be "e {a b} subcommand ?arg ...?"} -cleanup {
+ rename e {}
+ rename target {}
+}
test namespace-51.1 {name resolution path control} -body {
namespace eval ::test_ns_1 {