aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-11 12:38:10 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-11 12:39:33 +0100
commit7843645fef1470cddd503b1ffa1c7c337d21e74c (patch)
treec5da33dfc6d35b39d9cdb0e828813c6f658de307
parent23061c27188da281bcfb396855b01f8628298f87 (diff)
downloadrf-7843645fef1470cddd503b1ffa1c7c337d21e74c.tar.gz
fix '' and reflist bugs
-rwxr-xr-xrf7
1 files 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') {