Skip to content
Myr

Exit gracefully on broken pipe, fixes #24

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by sharkdp · parent 641ca69 · Browse files · 1 file+8 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−4 removed

  • other:+8 added−4 removed

1 file+8 added−4 removed

modified:src/main.rs+8 added-4 removed
136 unmodified lines
137 }138 }139 println!();140 } else {141 // Uncolorized output:141 // Uncolorized output142143 if config.path_display == PathDisplay::Absolute {144 print!("{}", ROOT_DIR);143 let prefix = if config.path_display == PathDisplay::Absolute { ROOT_DIR } else { "" };144145 let r = writeln!(&mut std::io::stdout(), "{}{}", prefix, path_str);146147 if r.is_err() {148 // Probably a broken pipe. Exit gracefully.149 process::exit(0);150 }146 println!("{}", path_str);151 }152}153154/// Recursively scan the given search path and search for files / pathnames matching the pattern.
142 unmodified lines