Artifacts Associated With Ticket 63449c0514
Ticket change [9d6c5d541b] (rid 222379) by stu on 2024-02-22 07:17:55:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
# Create namespaces namespace eval a { namespace eval b {} } # Good result with non-glob pattern, and global namespace namespace children :: a ;# => ::a # Good result with single-char glob pattern, and other namespace namespace children a {[b]} ;# => ::a::b # Good result because of glob char in pattern, and other namespace namespace children a b* ;# => ::a::b # Bad result with non-glob pattern, and other namespace namespace children a b ;# => {} In generic/tclNamespace.c, function NamespaceChildrenCmd (lines 2988-3108), Tcl_StringMatch will be called if a glob char is present in the pattern, otherwise the matching will be performed with a combination of strncmp() and Tcl_FindHashEntry: line 3067: if ((pattern != NULL) && TclMatchIsTrivial(pattern)) { The hash table lookup: line 3075 or 3078: Tcl_FindHashEntry(&nsPtr->childTable, pattern+length) != NULL These two chars might be added but they won't be taken into account when matching: lines 3053-3055: if (nsPtr != globalNsPtr) { TclDStringAppendLiteral(&buffer, "::"); } With a quick hack patch: -Tcl_FindHashEntry(&nsPtr->childTable, pattern+length) != NULL +Tcl_FindHashEntry(&nsPtr->childTable, 2+pattern+length) != NULL The child namespace can now be found: namespace children a b ;# => ::a::b However namespace ::a can no longer be found in the global namespace! namespace children :: a ;# => {} The two namespace separator ("::") chars are not being accounted for properly. - foundin initialized to: "Current"
- is_private initialized to: "0"
- login: "stu"
- priority initialized to: "5 Medium"
- private_contact initialized to: "702b65e835b7b4b4720d6e9d37fc582f82909394"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "stu"
- subsystem initialized to: "21. [namespace]"
- title initialized to:
[namespace children] doesn't match non-glob patterns below the global namespace
- type initialized to: "Bug"
Ticket change [8a9ab92662] (rid 222380) by stu on 2024-02-22 07:18:54:
- login: "stu"
- mimetype: "text/plain"
- priority changed to: "6"
- severity changed to: "Minor"
Ticket change [57bdb05e85] (rid 222381) by stu on 2024-02-22 07:32:03:
- icomment:
This patch handles global and non-global. q&d poc -Tcl_FindHashEntry(&nsPtr->childTable, 2+pattern+length) != NULL +Tcl_FindHashEntry(&nsPtr->childTable, (nsPtr != globalNsPtr ? 2 : 0)+pattern+length) != NULL
- login: "stu"
- mimetype: "text/plain"
- icomment:
Ticket change [8554d6b183] (rid 222382) by stu on 2024-02-22 07:33:25:
- icomment:
Correction: -Tcl_FindHashEntry(&nsPtr->childTable, pattern+length) != NULL +Tcl_FindHashEntry(&nsPtr->childTable, (nsPtr != globalNsPtr ? 2 : 0)+pattern+length) != NULL
- login: "stu"
- mimetype: "text/plain"
- icomment:
Ticket change [eb081ed907] (rid 227574) by stu on 2024-06-11 20:42:31:
- assignee changed to: "jan.nijtmans"
- login: "stu"
- mimetype: "text/plain"
Ticket change [2ffc6e8088] (rid 235670) by stu on 2024-12-02 15:02:07:
- icomment:
The patch is just a suggestion. The problem is an offset of 2 is not added when it should be. I'm not familiar enough with the code to pick the best place to do this.
- login: "stu"
- mimetype: "text/plain"
- username: "stu"
- icomment:
Ticket change [07b1d44ba1] (rid 235952) by jan.nijtmans on 2024-12-13 15:06:13:
- icomment: "Proposed fix [ee821ec00f|here]"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [7026cc66a6] (rid 235956) by jan.nijtmans on 2024-12-14 23:40:59:
- icomment:
The CI build shows no regressions. So, Yes I think this should be included into Tcl 9.0.2 (to be discussed within the TTT). Was this problem introduced in Tcl 8.7 or 9.0, or was it always there? Should it be backported to 8.7 and/or 8.6? Therefore, leaving this ticket open. No hurry to decide that.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [ca69ae2676] (rid 235957) by oehhar on 2024-12-15 10:04:56:
- icomment:
Great ! I would love some explanatory text around the fix source. Maybe, I care tomorrow ! And it is 9.0.1, not 9.0.2, right ? Take care, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehar"
- icomment:
Ticket change [51e89941a9] (rid 243634) by dgp on 2025-07-31 18:45:11:
- closedate changed to: "2460888.28138551"
- closer changed to: "dgp"
- icomment:
Backport landed on the 8.6 branch last December, so I guess the decision got made. Closing.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"