Index: generic/tclCmdIL.c
==================================================================
--- generic/tclCmdIL.c
+++ generic/tclCmdIL.c
@@ -735,11 +735,11 @@
 	    }
 	    Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
 	    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++) {
 		Namespace *pathNsPtr = nsPtr->commandPathArray[i].nsPtr;
 

Index: tests/namespace.test
==================================================================
--- tests/namespace.test
+++ tests/namespace.test
@@ -2551,10 +2551,20 @@
 	lappend result [namespace which $x]
     }
 } -cleanup {
     namespace delete ::test_ns_1
 } -result {::test_ns_1::ns::foo ::test_ns_1::foo}
+test namespace-51.19 {Bug 58b96f6744} -setup {
+    interp create i0
+} -body {
+    i0 eval {
+        namespace path ::tcl::mathfunc
+        info commands sin
+    }
+} -cleanup {
+    interp delete i0
+} -result {sin}
 
 # TIP 181 - namespace unknown tests
 test namespace-52.1 {unknown: default handler ::unknown} {
     set result [list [namespace eval foobar { namespace unknown }]]
     lappend result [namespace eval :: { namespace unknown }]

