Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#107 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
cli, operating-systems

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề với lệnh Windows ls và glob c:/Windows/*.exe bằng môi trường uutils coreutils 0.8.0 đã được báo cáo. Theo dõi cách các đường dẫn Windows được glob định dạng sau khi khớp. Hoàn thành khi các đường dẫn đầu ra giữ nguyên kiểu dấu gạch chéo từ mẫu đầu vào và có coverage cho ví dụ đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
5.2k
Fork
108
Merge trung bình
4 ngày 5 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/coreutils

Tất cả issue của microsoft/coreutils

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.