Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-08-11
14:50 • Closed ticket [4676f5c780]: glob -dir . returns corrupted/phantom entries near t... artifact: a8a9545721 user: apnadkarni
13:52
Merge 9.0. Fix [4676f5c78] - corrupted elements from glob -dir . in zipfs check-in: 6a61e9f919 user: apnadkarni tags: trunk, main
13:30
Fix [4676f5c78] - corrupted elements from glob -dir . in zipfs check-in: dd6eeb51fa user: apnadkarni tags: core-9-0-branch
2026-08-08
08:59 • Ticket [4676f5c780] glob -dir . returns corrupted/phantom entries near the top o... artifact: bcb6e3095d user: apnadkarni
08:57
Proposed fix for [4676f5c78] and more tests check-in: c97ece9549 user: apnadkarni tags: bug-4676f5c78
06:06
Bug [4676f5c78] - add tests to reproduce reported defect check-in: 036016befc user: apnadkarni tags: bug-4676f5c78
04:28 • Ticket [4676f5c780] glob -dir . returns corrupted/phantom entries near the top o... artifact: ec6678f590 user: apnadkarni
2026-08-03
22:12 • New ticket [4676f5c780]. artifact: 41d206f77b user: anonymous

glob -dir . returns corrupted/phantom entries near the top of the zipfs:/ tree

Closed / Fixed4676f5c780901f2df5b025b8270eaeabbfbd9095Created 121 days agoUpdated 113 days ago
Descriptionplain2026-08-03 22:12:33
Environment: Tcl 9.1b1, built from source (tclsh9.1), Ubuntu Linux.

Reproduction, from a fresh tclsh:


cd //zipfs://
pwd
glob *
glob -dir . *
cd lib
glob *
glob -dir . *
cd tcl
glob *
glob -dir . *
cd tcl_library
glob t*
glob -dir . t*

Actual output:


% cd //zipfs://
% pwd
//zipfs:/
% glob *
lib
% glob -dir . *
./ib/tcl
% cd lib
% glob *
tcl
% glob -dir . *
./tcl ./b/tcl
% cd tcl
% glob *
tcl_library
% glob -dir . *
./tcl_library
% cd tcl_library
% glob t*
tclIndex tcltest tm.tcl tzdata
% glob -dir . t*
./tclIndex ./tcltest ./tm.tcl ./tzdata

At //zipfs:/ (which contains only "lib"), plain glob * correctly returns "lib", but glob -dir . * returns "./ib/tcl" instead.

One level down, in lib (which contains only "tcl"), plain glob * correctly returns "tcl", but glob -dir . * returns "./tcl ./b/tcl".

Two levels down (lib/tcl) and further (lib/tcl/tcl_library), glob -dir . * and glob -dir . t* both return correct results, matching plain glob exactly.

This was repeatable for me. I'd appreciate it if someone could try the commands above and see if they get the same result.
apnadkarniplain2026-08-08 04:28:24
Confirmed to be a bug in 9.0 as well.
apnadkarniplain2026-08-08 08:59:14
Proposed fix in [c97ece9549].
apnadkarniplain2026-08-11 14:50:30
Fixed in [dd6eeb51fa].
Log in (anonymous is fine) to add a comment.