uutils/coreutils

stat: %N fails with new line

Open

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

在 GitHub 查看
 (1 留言) (1 反應) (0 負責人)Rust (23,246 star) (1,852 fork)batch import
U - statgood first issue

描述

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

貢獻者指南