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

贡献者指南