Skip to content

Commit bd51886

Browse files
committed
Merge branch 'js/diff-highlight-avoid-sigpipe'
* js/diff-highlight-avoid-sigpipe: diff-highlight: exit when a pipe is broken
2 parents b226293 + 251e7da commit bd51886

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

contrib/diff-highlight/diff-highlight

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ my @removed;
1414
my @added;
1515
my $in_hunk;
1616

17+
# Some scripts may not realize that SIGPIPE is being ignored when launching the
18+
# pager--for instance scripts written in Python.
19+
$SIG{PIPE} = 'DEFAULT';
20+
1721
while (<>) {
1822
if (!$in_hunk) {
1923
print;

0 commit comments

Comments
 (0)