mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:31 +00:00
Fix behavior on broken pipe
This commit is contained in:
1 parent
39a83021dc
commit
b27ab61608
1 file changed
+2
-2
+2
-2
@@ -271,7 +271,7 @@ fn run() -> Result<(), Box<::std::error::Error>> {
|
||||
printer.header();
|
||||
|
||||
let mut buffer = [0; BUFFER_SIZE];
|
||||
loop {
|
||||
'mainloop: loop {
|
||||
let size = reader.read(&mut buffer)?;
|
||||
if size == 0 {
|
||||
break;
|
||||
@@ -282,7 +282,7 @@ fn run() -> Result<(), Box<::std::error::Error>> {
|
||||
|
||||
if res.is_err() {
|
||||
// Broken pipe
|
||||
break;
|
||||
break 'mainloop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user