Skip to content

Fix glob path composition for Windows-style user profile paths - #374

Draft
msteveb with Copilot wants to merge 13 commits into
masterfrom
copilot/fix-glob-on-windows
Draft

Fix glob path composition for Windows-style user profile paths#374
msteveb with Copilot wants to merge 13 commits into
masterfrom
copilot/fix-glob-on-windows

Conversation

Copilot AI commented May 7, 2026

Copy link
Copy Markdown

glob failed on Windows-style patterns derived from paths like C:\Users\bob because internal path handling mixed slash-specific string concatenation with file APIs. This change makes path composition file-aware and adds focused regression coverage for Windows-style patterns.

  • Core glob path handling

    • Replaced slash-based existence checks with file join in glob.globdir.
    • Removed hardcoded / concatenation in glob.glob and switched to file-aware composition for returned tail paths.
    • Preserved literal .* behavior (e.g. dir/. distinct from dir) while keeping separator handling compatible with Windows platform semantics.
  • Windows-path regression coverage (tests/glob.test)

    • Added fake-FS path normalization for backslash inputs to match internal fake filesystem representation.
    • Added isolated Windows-style fixture data (drive + user profile tree) used only by new tests.
    • Added success and error regressions for:
      • glob [file join {C:\Users\bob} *]
      • drive-root style matching (C:*)
      • missing profile path error shape.
# Before: slash-specific composition
if {[file exists $dir/$pattern]} { ... }

# After: file-aware composition
if {[file exists [file join $dir $pattern]]} { ... }

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.google.com
    • Triggering command: /home/REDACTED/work/jimtcl/jimtcl/jimsh /home/REDACTED/work/jimtcl/jimtcl/jimsh /home/REDACTED/work/jimtcl/jimtcl/tests/runall.tcl -D _GNU_SOURCE _nshelper.c -D_FORTIFY_SOURCE=3 -quiet -dumpbase nshelper.c -dumpbase-ext .c -mtune=generic -plu�� /usr/libexec/gccjim-signal.o -plugin-opt=/usr/tmp/cc8wbcd8.s s -plugin-opt=-pasas -plugin-opt=-pas-I -plugin-opt=-pas. as (dns block)
    • Triggering command: /home/REDACTED/work/jimtcl/jimtcl/jimsh /home/REDACTED/work/jimtcl/jimtcl/jimsh /home/REDACTED/work/jimtcl/jimtcl/tests/runall.tcl /x86_64-linux-gnu/13/collect2 cat gorp�� ndor/bin/cc /x86_64-linux-gnu/13/collect2 e /x86_64-linux-gngit /libexec/gcc/x86commit tnet/tools/echo echo firs�� s-through=-lc s-through=-lgcc /usr/local/sbin/cat . --64 k/_temp/ghcca-no-m cat (dns block)
    • Triggering command: /home/REDACTED/work/jimtcl/jimtcl/jimsh /home/REDACTED/work/jimtcl/jimtcl/jimsh /home/REDACTED/work/jimtcl/jimtcl/tests/runall.tcl bash cat hts k/_temp/ghcca-no-o cc de/node/bin/echoloadtest.o -fPIC -I/home/REDACTED/w-shared ndor/bin/echo echo Seco�� 2 bash k/_temp/ghcca-noloadtest.so --noprofile cat nfig/composer/ve--noprofile cat (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue May 7, 2026 that may be closed by this pull request
Copilot AI and others added 12 commits May 7, 2026 22:39
Agent-Logs-Url: https://github.com/msteveb/jimtcl/sessions/27b8a62f-9943-45df-b34d-98edea870c78

Co-authored-by: msteveb <188705+msteveb@users.noreply.github.com>
Agent-Logs-Url: https://github.com/msteveb/jimtcl/sessions/27b8a62f-9943-45df-b34d-98edea870c78

Co-authored-by: msteveb <188705+msteveb@users.noreply.github.com>
Agent-Logs-Url: https://github.com/msteveb/jimtcl/sessions/27b8a62f-9943-45df-b34d-98edea870c78

Co-authored-by: msteveb <188705+msteveb@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix glob functionality on Windows for user profiles Fix glob path composition for Windows-style user profile paths May 7, 2026
Copilot finished work on behalf of msteveb May 7, 2026 22:51
Copilot AI requested a review from msteveb May 7, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

glob doesn't work correctly on windows

2 participants