Subject: | invalid directory ending causes results in next() to return early |
All uses of _warn() in MARC::File::USMARC simply stash away the warning
for later retrieval, except for two uses:
# character after the directory must be \x1e
(substr($text, $data_start-1, 1) eq END_OF_FIELD)
or return $marc->_warn( "No directory found $location" );
# all directory entries 12 bytes long, so length % 12 must be 0
(length($dir) % DIRECTORY_ENTRY_LEN == 0)
or return $marc->_warn( "Invalid directory length $location" );
Notice how they return? MARC::Record::_warn() stashes away the warning
and then returns the MARC::Record object. This means that we end up
returning a partial record, instead of motoring on like other other uses
of _warn.