diff options
| author | Enrico Borba <enricozb@users.noreply.github.com> | 2024-12-23 09:23:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-23 09:23:58 +0100 |
| commit | 52125e6336d596aebdd4da91080b3178ddca7449 (patch) | |
| tree | 27d3e5c01660d567f22fee621c97753f294256b0 /rc/filetype/diff-parse.pl | |
| parent | 14cb35f62b36b2f1aa530adb5e31c05ff1347bfc (diff) | |
| parent | 9c458c50661446fc6e7295787b06422137af099d (diff) | |
Merge branch 'master' into enricozb/daemon-stdin
Diffstat (limited to 'rc/filetype/diff-parse.pl')
| -rwxr-xr-x | rc/filetype/diff-parse.pl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rc/filetype/diff-parse.pl b/rc/filetype/diff-parse.pl index 203e9b19..5da4e349 100755 --- a/rc/filetype/diff-parse.pl +++ b/rc/filetype/diff-parse.pl @@ -9,8 +9,8 @@ sub quote { } sub fail { my $reason = shift; - print "set-register e fail " . quote("diff-parse.pl: $reason"); - exit; + print quote("diff-parse.pl: $reason"); + exit 1; } my $begin; @@ -45,13 +45,15 @@ our $version = "+"; eval $begin if defined $begin; -$in_file = "$directory/$in_file" if defined $in_file; +$in_file = "$directory/$in_file" if defined $in_file && $in_file ne ""; # Outputs our $diff_line = 0; our $commit; our $file; our $file_line; +our $other_file; +our $other_file_line; our $diff_line_text; my $other_version; @@ -63,8 +65,6 @@ if ($version eq "+") { my $is_recursive_diff = 0; my $state = "header"; my $fallback_file; -my $other_file; -my $other_file_line; sub strip { my $is_recursive_diff = shift; @@ -127,7 +127,7 @@ while (<STDIN>) { $other_file_line++ if defined $other_file_line; } } - if (defined $in_file and defined $file and $file eq $in_file) { + if (defined $in_file and defined $file and ($in_file eq "" or $file eq $in_file)) { if (defined $in_file_line and defined $file_line and $file_line >= $in_file_line) { last; } |
