uutils/coreutils

stat: %N fails with new line

已關閉

#9,925 建立於 2025年12月30日

 (1 則留言) (1 個反應) (0 位負責人)Rust (1,981 個分叉)batch import
U - statgood first issue

倉庫指標

星標
 (23,893 顆星)
PR 合併指標
 (平均合併 5天 23小時) (30 天內合併 239 個 PR)

描述

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'"}

貢獻者指南