X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FWebPAC%2FNormalize.pm;h=03ee351fbe3187e580e98db762d8a6d51d6e9db5;hb=fb8372edae6f5af441c1b7ee73b073b1511df4e5;hp=a65b1444658fb600c86a3d894bd1ab190bb8f8a8;hpb=498f83cfb234ce44280b107e683e83a108153bf1;p=webpac2 diff --git a/lib/WebPAC/Normalize.pm b/lib/WebPAC/Normalize.pm index a65b144..03ee351 100644 --- a/lib/WebPAC/Normalize.pm +++ b/lib/WebPAC/Normalize.pm @@ -535,12 +535,14 @@ sub marc_fixed { my ($f, $pos, $val) = @_; die "need marc(field, position, value)" unless defined($f) && defined($pos); + confess "need val" unless defined $val; + my $update = 0; map { if ($_->[0] eq $f) { my $old = $_->[1]; - if (length($old) < $pos) { + if (length($old) <= $pos) { $_->[1] .= ' ' x ( $pos - length($old) ) . $val; warn "## marc_fixed($f,$pos,'$val') append '$old' -> '$_->[1]'\n" if ($debug > 1); } else {