File: partial-refine.riff-output

package info (click to toggle)
rust-riffdiff 3.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 5,784 kB
  • sloc: sh: 206; python: 132; makefile: 11
file content (21 lines) | stat: -rw-r--r-- 897 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/xsrc/main.rs b/xsrc/main.rs
index 55a7c18..8826249 100644
--- a/xsrc/main.rs
+++ b/xsrc/main.rs
@@ -90,7 +91,15 @@ fn get_fixed_highlight(line: &str) -> &str {
 }

 fn print(stream: &mut BufWriter<&mut dyn Write>, text: &str) {
-    stream.write_all(text.as_bytes()).unwrap();
+    if let Err(error) = stream.write_all(text.as_bytes()) {
+        if error.kind() == ErrorKind::BrokenPipe {
+            // This is fine, somebody probably just quit their pager before it
+            // was done reading our output.
+            exit(0);
+        }
+
+        panic!("Error writing diff to pager: {:?}", error);
+    }
 }

 fn println(stream: &mut BufWriter<&mut dyn Write>, text: &str) {