Skip to content

Commit

Permalink
Function yaz_record handles MARC records that have identifers in 00X.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Dickmeiss committed Jul 19, 2001
1 parent 30ec364 commit 863062a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ext/yaz/php_yaz.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@ static Z_GenericRecord *marc_to_grs1(const char *buf, ODR o, Odr_oid *oid)
int end_offset;
int i;
char tag_str[4];
int identifier_flag = 1;

memcpy (tag_str, buf+entry_p, 3);
entry_p += 3;
Expand Down Expand Up @@ -1544,8 +1545,16 @@ static Z_GenericRecord *marc_to_grs1(const char *buf, ODR o, Odr_oid *oid)
entry_p += length_starting;
i = data_offset + base_address;
end_offset = i+data_length-1;

if (indicator_length == 2)
{
if (buf[i + indicator_length] != ISO2709_IDFS)
identifier_flag = 0;
}
else if (!memcmp (tag_str, "00", 2))
identifier_flag = 0;

if (memcmp (tag_str, "00", 2) && indicator_length)
if (identifier_flag && indicator_length)
{
/* indicator */
tag->tagValue->u.string = odr_malloc(o, indicator_length+1);
Expand Down

0 comments on commit 863062a

Please sign in to comment.