print_xml_record(octet_buf, octet_len);
}
- else if (yaz_oid_is_iso2709(oid))
+ else
{
const char *result;
size_t rlen;
}
else
{
- printf("bad MARC. Dumping as it is:\n");
+ if (yaz_oid_is_iso2709(oid))
+ printf("bad MARC. Dumping as it is:\n");
print_record(octet_buf, octet_len);
}
yaz_marc_destroy(mt);
if (cd)
yaz_iconv_close(cd);
}
- else
- {
- print_record(octet_buf, octet_len);
- }
marc_file_write(octet_buf, r->u.octet_aligned->len);
}
else if (oid && !oid_oidcmp(oid, yaz_oid_recsyn_sutrs))
charset);
else if (r->which == Z_External_octet)
{
- if (yaz_oid_is_iso2709(oid))
- {
- const char *ret_buf = return_marc_record(
- wrbuf, marctype, len,
- (const char *) r->u.octet_aligned->buf,
- r->u.octet_aligned->len,
- charset);
- if (ret_buf)
- return ret_buf;
- /* bad ISO2709. Return fail unless raw (ISO2709) is wanted */
- if (marctype != YAZ_MARC_ISO2709)
- return 0;
- }
+ const char *ret_buf = return_marc_record(
+ wrbuf, marctype, len,
+ (const char *) r->u.octet_aligned->buf,
+ r->u.octet_aligned->len,
+ charset);
+ if (ret_buf)
+ return ret_buf;
+ /* not ISO2709. Return fail unless raw (ISO2709) is wanted */
+ if (yaz_oid_is_iso2709(oid) && marctype != YAZ_MARC_ISO2709)
+ return 0;
return return_string_record(wrbuf, len,
(const char *) r->u.octet_aligned->buf,
r->u.octet_aligned->len,