From 7843645fef1470cddd503b1ffa1c7c337d21e74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 11 Nov 2020 12:38:10 +0100 Subject: fix '' and reflist bugs --- rf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rf b/rf index bc1b28f..754bc70 100755 --- a/rf +++ b/rf @@ -11,9 +11,9 @@ my $format_list = '%a (%y). {\fI%t\fR}. {\*Q%q\*U}. %n, %d. %c: %p. {Available: # Internal variables -my $author_last = 0; # whether the previous reference field was Ra +my $author_last = 1; # whether the previous reference field was Ra my @lines; -my $i = -1; +my $i = 0; my @refs; while (<>) { @@ -63,6 +63,7 @@ for (@lines) { for (@words) { if ($_ eq "''") { $_ = $lines[$i-1]; + chomp; $_ =~ s/^.*\s(\S+)\s*$/$1/; } } @@ -81,7 +82,7 @@ for (@lines) { exit 1; } if ($points[$winner] < 150) { - print STDERR "Warning: Guessing that reference '$def' refers to " . fmt($format_full, $winner) . ".\n"; + print STDERR "Warning: Guessing that reference '$def' refers to " . fmt($format_full, $winner) . " (match = $points[$winner]).\n"; } if ($fld eq 'f') { -- cgit v1.2.3