aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-11 09:33:26 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-11 09:33:26 +0100
commit0a2b57c68ee6d159fc9010e30a93da1e39bc35ca (patch)
treee504b4b5be4bf2e18c1022a1d105b5e2d501a1be
parent6544282d384e1284b53241c820b17e4f3ad010fe (diff)
downloadrf-0a2b57c68ee6d159fc9010e30a93da1e39bc35ca.tar.gz
fix alt inline ref bug
-rwxr-xr-xrf7
1 files changed, 4 insertions, 3 deletions
diff --git a/rf b/rf
index bf54bb5..ec47269 100755
--- a/rf
+++ b/rf
@@ -51,12 +51,13 @@ for (@lines) {
$i++;
# Inline reference
if (/^\.R([fx]) +(.*)/) {
+ my ($suffix, $prefix, @points);
my ($fld, $def) = ($1, $2);
- $def =~ s/ ([.,:;\])]) ?([\[(])?$//;
- my ($suffix, $prefix) = ($1, $2);
+ if ($def =~ s/ ([.,:;\])]) ?([\[(])?$//) {
+ ($suffix, $prefix) = ($1, $2);
+ }
my $winner = 0;
my @words = split /\s/, $def;
- my @points;
# replace '' with preceding word
for (@words) {