From: Adam Dickmeiss Date: Tue, 29 Sep 2009 10:58:40 +0000 (+0200) Subject: ZOOM_record_get returns 0 for bad MARC. X-Git-Tag: v3.0.49~5 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=a5ebdfbdd3845ef01e1c2e8d19daae12fc2f036e;p=yaz-moved-to-github.git ZOOM_record_get returns 0 for bad MARC. ZOOM_record_get returns 0 pointer if a MARC record can not be decoded - unless type desired is "raw". This will prevent type "xml" from returning ISO2709 .. Which obviously can not be XML parsed. --- diff --git a/src/zoom-c.c b/src/zoom-c.c index d0f5042..e05de20 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -1971,6 +1971,9 @@ static const char *return_record(ZOOM_record rec, int *len, charset); if (ret_buf) return ret_buf; + /* bad ISO2709. Return fail unless raw (ISO2709) is wanted */ + if (marctype != YAZ_MARC_ISO2709) + return 0; } return return_string_record(rec, len, (const char *) r->u.octet_aligned->buf,