skip fields with length 0, OpenIsis produce binary junk in this case.
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Dec 2004 16:04:07 +0000 (16:04 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Dec 2004 16:04:07 +0000 (16:04 +0000)
git-svn-id: file:///home/dpavlin/svn/Biblio-Isis/trunk@10 4670fa4d-42ec-0310-ab5b-a66af6943492

IsisDB.pm

index 6ca64f1..ac0e051 100644 (file)
--- a/IsisDB.pm
+++ b/IsisDB.pm
@@ -329,6 +329,9 @@ print ("Error: The MFN:".$mfn." is not found in MST(".$value.")");
        read($self->{'fileMST'},$buff,$fld_len);
 
        for (my $i = 0 ; $i < $NVF ; $i++) {
        read($self->{'fileMST'},$buff,$fld_len);
 
        for (my $i = 0 ; $i < $NVF ; $i++) {
+               # skip zero-sized fields
+               next if ($FieldLEN[$i] == 0);
+
                push @{$self->{record}->{$FieldTAG[$i]}}, substr($buff,$FieldPOS[$i],$FieldLEN[$i]);
        }
        close(fileMST);
                push @{$self->{record}->{$FieldTAG[$i]}}, substr($buff,$FieldPOS[$i],$FieldLEN[$i]);
        }
        close(fileMST);