Artifacts Associated With Ticket e860418c
Ticket change [9ffd549a83] (rid 253717) by apnadkarni on 2026-05-21 06:58:31:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-markdown"
- comment initialized to:
Originally reported by @JulianNoble in the discussion in unrelated issue [596936dd2d](https://core.tcl-lang.org/tcl/tktview/596936dd) ``` When you do a glob -dir $dir -tail on a dir ending in a slash - it can return /name instead of just name Then the file join fails to work as it takes the name as an absolute path and doesn't add the dir. #with trailing slash in path % set path {C:\Program Files\PowerShell\7} C:\Program Files\PowerShell\7 % tcl::unsupported::representation $path value is a pure string with a refcount of 4, object pointer at 0x1ea036f3270, string representation "C:\Program Fi..." % append path \\ C:\Program Files\PowerShell\7\ % tcl::unsupported::representation $path value is a utf32string with a refcount of 2, object pointer at 0x1ea036ef2e0, internal representation 0x1ea038c70b0:0x0, string representation "C:\Program Fi..." % glob -dir $path -tail pwsh.exe /pwsh.exe #without trailing slash % set path {C:\Program Files\PowerShell\7} C:\Program Files\PowerShell\7 % tcl::unsupported::representation $path value is a pure string with a refcount of 5, object pointer at 0x1ea036f3270, string representation "C:\Program Fi..." % glob -dir $path -tail pwsh.exe pwsh.exe Whether or not a trailing slash should strictly exist at the end of a path - I believe it to be fairly common on windows (some installers do it) and it should work. Tcl8.5 on the other hand does it correctly: % glob -dir "c:\\" -tail windows-version.txt windows-version.txt versus testing in 8.6, 8.7, 9.0 % glob -dir "c:\\" -tail windows-version.txt /windows-version.txt ``` - foundin initialized to: "8.6"
- is_private initialized to: "0"
- login: "apnadkarni"
- priority initialized to: "5 Medium"
- private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "apnadkarni"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to:
glob -dir $dir -tail returns name with leading / if $dir ends in a /
- type initialized to: "Bug"
Ticket change [24e277f1ea] (rid 253849) by apnadkarni on 2026-05-24 09:13:24:
- assignee changed to: "apnadkarni"
- icomment:
Forward slashes seem to work fine. ``` % glob -dir c:/ -tail windows windows ``` And without `-tail` output seem ok but weird, unnecessary escaping. ``` % glob -dir c:\\ windows {c:\/windows} ``` - login: "apnadkarni"
- mimetype: "text/x-markdown"
Ticket change [282f0831dc] (rid 253855) by apnadkarni on 2026-05-24 11:19:56:
- icomment:
And my second example, which I thought was cosmetic, is also a bug (double escapes). Proposed fix for both in bug-e860418c branch.
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [867a2379f6] (rid 253901) by apnadkarni on 2026-05-25 11:01:34:
- closedate changed to: "2461185.9594237036"
- closer changed to: "apnadkarni"
- icomment: "Fixed in [9f84d3ca4d] for 9.0.4 onward."
- login: "apnadkarni"
- mimetype: "text/x-fossil-plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"