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

贡献者指南