Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ls: preserves backslashes in output even when glob pattern uses forward slashes

Aperta
#107 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Inizia riproducendo il problema con il comando Windows ls e il glob c:/Windows/*.exe usando l'ambiente uutils coreutils 0.8.0 indicato. Traccia il modo in cui i percorsi Windows ottenuti tramite glob vengono formattati dopo il matching. Il lavoro è completato quando i percorsi nell'output preservano lo stile delle barre oblique del pattern di input, con una copertura per l'esempio segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

C-bug

When running ls with a glob pattern that uses forward slashes (for example, c:/Windows/*.exe), the output paths are normalized to backslashes instead of preserving the separator style used in the input pattern.

This makes the output inconsistent with the command that was typed, and it can break scripts or tools that parse ls output and expect the path format to remain stable.

Steps to Reproduce

C:\Windows> ls c:/Windows/*.exe

Actual Output

'c:/Windows\HelpPane.exe'
'c:/Windows\bfsvc.exe'
'c:/Windows\notepad.exe'
'c:/Windows\write.exe'
...

Expected Output

'c:/Windows/HelpPane.exe'
'c:/Windows/bfsvc.exe'
'c:/Windows/notepad.exe'
'c:/Windows/write.exe'
...

Why This Matters

The output should be consistent with the path style used in the input glob pattern. When ls output is used for programmatic parsing, the unexpected separator conversion can cause parsing failures or make downstream processing more difficult.

Environment

  • OS: Windows
  • Shell: Command Prompt (cmd.exe)
  • coreutils version: ls (uutils coreutils) 0.8.0

Comparison with WSL

For reference, ls under WSL does not show this issue in the same way:

user@pc:/mnt/c/Users/USER$ ls /mnt/c/Windows/*.exe
/mnt/c/Windows/HelpPane.exe  /mnt/c/Windows/explorer.exe  /mnt/c/Windows/notepad.exe  /mnt/c/Windows/splwow64.exe
/mnt/c/Windows/bfsvc.exe     /mnt/c/Windows/hh.exe        /mnt/c/Windows/regedit.exe  /mnt/c/Windows/winhlp32.exe

This makes the Windows build look inconsistent compared with the WSL behavior for the same kind of globbed output.

Additional Note

I could not find an existing issue for this specific behavior.

Lingua principale
Rust
Stelle
5.2k
Fork
108
Merge medio
4g 5h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/coreutils

Tutte le issue di microsoft/coreutils

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.