projects
/
webpac2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make missing value in marc_fixed confess and fixed warning
[webpac2]
/
lib
/
WebPAC
/
Normalize.pm
diff --git
a/lib/WebPAC/Normalize.pm
b/lib/WebPAC/Normalize.pm
index
a65b144
..
03ee351
100644
(file)
--- 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);
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];
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 {
$_->[1] .= ' ' x ( $pos - length($old) ) . $val;
warn "## marc_fixed($f,$pos,'$val') append '$old' -> '$_->[1]'\n" if ($debug > 1);
} else {