fix: keep a path's bytes, so a filename that is not utf-8 survives
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user