fix: keep a path's bytes, so a filename that is not utf-8 survives

This commit is contained in:
2026-09-09 12:01:59 +00:00
parent b4b6d5918f
commit e146b0460a
8 changed files with 172 additions and 72 deletions

View File

@@ -53,6 +53,13 @@ pub(crate) fn write_text(args: Arguments) {
}
}
// a path on unix is bytes, not text, so a record naming one is written as bytes
pub(crate) fn write_bytes(bytes: &[u8]) {
if writable() {
finish(io::stdout().write_all(bytes));
}
}
// stderr is commentary about the work, not the work itself. there is nowhere to
// report that it could not be written, so the error goes nowhere -- eprintln!
// panics instead, which turns a closed pipe into a crash