X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmarcdisp.c;h=1b02e110102ee69115fa60872122dea250e58bc1;hb=05a79698b4956c63642ebd0b4deedf56098c255c;hp=171e5a3dff1264acb944a34bea00ea550a493e85;hpb=537450adf56c59b3f26ac9320cc6dd12b3ffdbb5;p=yaz-moved-to-github.git diff --git a/src/marcdisp.c b/src/marcdisp.c index 171e5a3..1b02e11 100644 --- a/src/marcdisp.c +++ b/src/marcdisp.c @@ -2,7 +2,12 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: marcdisp.c,v 1.7 2004-10-01 11:45:48 adam Exp $ + * $Id: marcdisp.c,v 1.9 2004-11-25 09:43:10 adam Exp $ + */ + +/** + * \file marcdisp.c + * \brief Implements MARC display - and conversion utilities */ #if HAVE_CONFIG_H @@ -242,7 +247,7 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) int end_offset; int i, j; char tag[4]; - int identifier_flag = 1; + int identifier_flag = 0; memcpy (tag, buf+entry_p, 3); entry_p += 3; @@ -256,11 +261,13 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) if (indicator_length < 4 && indicator_length > 0) { - if (buf[i + indicator_length] != ISO2709_IDFS) - identifier_flag = 0; + if (buf[i + indicator_length] == ISO2709_IDFS) + identifier_flag = 1; + else if (buf[i + indicator_length + 1] == ISO2709_IDFS) + identifier_flag = 2; } - else if (!memcmp (tag, "00", 2)) - identifier_flag = 0; + else if (memcmp (tag, "00", 2)) + identifier_flag = 1; switch(mt->xml) { @@ -294,6 +301,7 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) if (identifier_flag) { + i += identifier_flag-1; for (j = 0; jxml)