From 8c34dae60a1bc9735292010a87fd6dd736f830a6 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Wed, 9 Mar 2016 04:15:05 -0800 Subject: [PATCH] Adjust hunk header regex for reality. Now works on hunks like: @@@ -48,10 -48,10 +48,15 @@@ --- libs/header_clean/header_clean.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/header_clean/header_clean.pl b/libs/header_clean/header_clean.pl index ae279d0..e3fecb9 100755 --- a/libs/header_clean/header_clean.pl +++ b/libs/header_clean/header_clean.pl @@ -108,7 +108,7 @@ sub parse_hunk_header { my ($line) = @_; my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = - $line =~ /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/; + $line =~ /^@@+(?: -(\d+)(?:,(\d+))?)+ \+(\d+)(?:,(\d+))? @@+/; $o_cnt = 1 unless defined $o_cnt; $n_cnt = 1 unless defined $n_cnt; return ($o_ofs, $o_cnt, $n_ofs, $n_cnt);