uutils/coreutils

stat: %N fails with new line

クローズ

#9,925 opened on 2025/12/30

 (1 件のコメント) (1 件のリアクション) (0 人の担当者)Rust (1,981 件のフォーク)batch import
U - statgood first issue

Repository metrics

Stars
 (23,893 個のスター)
PR merge metrics
 (平均マージ 5d 23h) (30d で 239 merged PRs)

説明

touch $'/tmp/test\nnewline'

FORMAT='{"name":"%N"}'

# GNU stat (correct)
/usr/bin/stat -c "$FORMAT" $'/tmp/test\nnewline'
# Output: {"name":"'/tmp/test'$'\n''newline'"}

# uutils stat (broken)
./target/debug/coreutils stat -c "$FORMAT" $'/tmp/test\nnewline'
# Output: {"name":"'/tmp/test
# newline'"}

rm -f $'/tmp/test\nnewline'
{"name":"'/tmp/test'$'\n''newline'"}
{"name":"'/tmp/test
newline'"}

コントリビューターガイド