From f5234a7d67df11584a2f29b35d999a603ab9cc80 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 25 Nov 2004 09:43:10 +0000 Subject: [PATCH] Treat field as having subfields even if first char is blank/other --- src/marcdisp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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) -- 1.7.10.4