summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraspect <aspect+tclcore@abstracted-spleen.org>2017-02-12 12:17:35 (GMT)
committeraspect <aspect+tclcore@abstracted-spleen.org>2017-02-12 12:17:35 (GMT)
commita081c18d9d5c30c00085cb0fe6ad00b9e6de40d2 (patch)
tree6e3c23e2ea89a0fad7920f348ba1e65b18625183
parent304de510732b5bf301c6d97ca26f876dca26886e (diff)
downloadtcl-bug_58b96f6744.zip
tcl-bug_58b96f6744.tar.gz
tcl-bug_58b96f6744.tar.bz2
make [info commands] follow the namespace path from :: (bug [58b96f6744])bug_58b96f6744
-rw-r--r--generic/tclCmdIL.c2
-rw-r--r--tests/namespace.test8
2 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index b303bb6..6972f59 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -670,7 +670,7 @@ InfoCommandsCmd(
Tcl_SetObjResult(interp, listPtr);
return TCL_OK;
}
- if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
+ if (!specificNsInPattern) {
Tcl_HashTable *tablePtr = NULL; /* Quell warning. */
for (i=0 ; i<nsPtr->commandPathLength ; i++) {
diff --git a/tests/namespace.test b/tests/namespace.test
index 71b6860..aee1767 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -2462,6 +2462,14 @@ test namespace-51.14 {name resolution path control} -body {
catch {namespace delete ::test_ns_2}
catch {namespace delete ::test_ns_3}
}
+test namespace-51.14.1 {info commands follows path from global namespace (bug [58b96f6744])} -setup {
+ set p [namespace path]
+ namespace path ::tcl::mathfunc
+} -body {
+ info commands sin
+} -cleanup {
+ namespace path $p
+} -result sin
test namespace-51.15 {namespace resolution path control} -body {
namespace eval ::test_ns_2 {
proc foo {} {return 2}