Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#107 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust

調査の方向性

報告された uutils coreutils 0.8.0 環境を使い、Windows の ls コマンドと glob c:/Windows/*.exe で問題を再現することから始めます。glob によるマッチング後に、Windows パスがどのようにフォーマットされるかを追跡します。入力パターンのスラッシュ形式が出力パスでも維持され、報告された例を対象とするカバレッジがあれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
5.2k
フォーク
108
平均マージ
4日 5時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/coreutils のほかの issue

microsoft/coreutils の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。