ZOOM_record_get returns 0 for bad MARC.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 29 Sep 2009 10:58:40 +0000 (12:58 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 29 Sep 2009 10:58:40 +0000 (12:58 +0200)
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.

src/zoom-c.c

index d0f5042..e05de20 100644 (file)
@@ -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,