Skip to content

Commit 7540a69

Browse files
committed
convertpatch-to: try to avoid edge case
1 parent 0bbb4e2 commit 7540a69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

convertpatch-to

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ if (scalar @ARGV) {
3232
$diff=join(' ', @ARGV);
3333
}
3434

35-
my (@pairs, $skip, $a, $b);
35+
my (@pairs, $skip);
36+
my ($a, $b) = ('', '');
3637

3738
my $escape='\x1b\[0';
3839
my $boldred=$escape.';31;1;4m';
@@ -59,7 +60,7 @@ while (<DIFF>) {
5960
$a=$1;
6061
} elsif (m!$boldgrn(.*)\n!) {
6162
$b=$1;
62-
push @pairs, [$a, $b];
63+
push @pairs, [$a, $b] if $a ne '';
6364
$a="";
6465
$b="";
6566
}

0 commit comments

Comments
 (0)