aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrf9
1 files changed, 7 insertions, 2 deletions
diff --git a/rf b/rf
index 76d013f..5822447 100755
--- a/rf
+++ b/rf
@@ -169,8 +169,13 @@ sub fmt {
my $val = $ref{lc $fld};
$val = join '; ', @$val if lc $fld eq 'a';
$val = fmtl($val) if $fld eq 'A';
- $fmt =~ s/\{([^{}%]*)%\Q$fld\E([^{}]*)}/$1$val$2/g;
- $fmt =~ s/%\Q$fld\E/$val/g;
+ if ($val =~ /\.$/) {
+ $fmt =~ s/\{([^{}%]*)%\Q$fld\E([^{}]*)}\.?/$1$val$2/g;
+ $fmt =~ s/%\Q$fld\E\.?/$val/g;
+ } else {
+ $fmt =~ s/\{([^{}%]*)%\Q$fld\E([^{}]*)}/$1$val$2/g;
+ $fmt =~ s/%\Q$fld\E/$val/g;
+ }
} else {
no warnings;
$fmt =~ s/[.([]?\{([^{}%]*)%\Q$fld\E([^{}]*)}[.,?!:;\])]?//g;