uutils/coreutils

stat: %N fails with new line

Chiusa

#9925 aperta il 30 dic 2025

 (1 commento) (1 reazione) (0 assegnatari)Rust (1976 fork)batch import
U - statgood first issue

Metriche repository

Star
 (23.854 stelle)
Metriche merge PR
 (Merge medio 5g 23h) (239 PR mergiate in 30 g)

Descrizione

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

Guida contributor