X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fmarcdisp.c;h=1b02e110102ee69115fa60872122dea250e58bc1;hp=2e3f96a333dfabc6b32867543c47e81932d59732;hb=f5234a7d67df11584a2f29b35d999a603ab9cc80;hpb=b6ed17b957403d2db0475df7759de72ce3eda2ee diff --git a/src/marcdisp.c b/src/marcdisp.c index 2e3f96a..1b02e11 100644 --- a/src/marcdisp.c +++ b/src/marcdisp.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: marcdisp.c,v 1.8 2004-10-15 00:19:00 adam Exp $ + * $Id: marcdisp.c,v 1.9 2004-11-25 09:43:10 adam Exp $ */ /** @@ -247,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; @@ -261,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) { @@ -299,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)