Skip to content

Commit 8c34dae

Browse files
committed
Adjust hunk header regex for reality.
Now works on hunks like: @@@ -48,10 -48,10 +48,15 @@@
1 parent 74804e3 commit 8c34dae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/header_clean/header_clean.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
sub parse_hunk_header {
109109
my ($line) = @_;
110110
my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) =
111-
$line =~ /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;
111+
$line =~ /^@@+(?: -(\d+)(?:,(\d+))?)+ \+(\d+)(?:,(\d+))? @@+/;
112112
$o_cnt = 1 unless defined $o_cnt;
113113
$n_cnt = 1 unless defined $n_cnt;
114114
return ($o_ofs, $o_cnt, $n_ofs, $n_cnt);

0 commit comments

Comments
 (0)