Tcl Source Code

View Ticket
Login
Ticket UUID: 4676f5c780901f2df5b025b8270eaeabbfbd9095
Title: glob -dir . returns corrupted/phantom entries near the top of the zipfs:/ tree
Type: Bug Created on: 2026-08-03 22:12:33
Submitter: anonymous Assigned to: nobody
Subsystem: 37. File System Severity: Important
Priority: 5 Medium Last modified: 2026-08-11 14:50:30
Status: Closed Closed by: apnadkarni
Resolution: Fixed Closed on: 2026-08-11 14:50:30
Version: 9.0
Description:
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.
User Comments:
apnadkarni added on 2026-08-08 04:28:24:
Confirmed to be a bug in 9.0 as well.

apnadkarni added on 2026-08-08 08:59:14:
Proposed fix in [c97ece9549].

apnadkarni added on 2026-08-11 14:50:30:
Fixed in [dd6eeb51fa].