projects
/
webpac2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ccb0019
)
sort leader offsets to support marc_clone
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 2 May 2015 20:35:47 +0000
(22:35 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 2 May 2015 20:35:47 +0000
(22:35 +0200)
marc_clone creates full leader with offset 0, so if it ends up as last
element (and order of keys is not defined) it will overwrite all other
leader elements
lib/WebPAC/Output/MARC.pm
patch
|
blob
|
history
diff --git
a/lib/WebPAC/Output/MARC.pm
b/lib/WebPAC/Output/MARC.pm
index
cd22add
..
89e38fe
100644
(file)
--- a/
lib/WebPAC/Output/MARC.pm
+++ b/
lib/WebPAC/Output/MARC.pm
@@
-122,7
+122,7
@@
sub add {
my $leader = $marc->leader;
- foreach my $o ( keys %$new_l ) {
+ foreach my $o (
sort { $a <=> $b }
keys %$new_l ) {
my $insert = $new_l->{$o};
$leader = substr($leader, 0, $o) .
$insert . substr($leader, $o+length($insert));