From: Adam Dickmeiss Date: Thu, 22 Nov 2001 11:04:48 +0000 (+0000) Subject: Fixed dup display of records (bug introduced by previous commit). X-Git-Tag: YAZ.1.8.4~14 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=d8bf5f7a48d0abb1db4bcb6ffceb74f2df8eae76;p=yaz-moved-to-github.git Fixed dup display of records (bug introduced by previous commit). --- diff --git a/client/client.c b/client/client.c index 82586b5..1761183 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2001, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.132 2001-11-21 11:13:13 adam Exp $ + * $Id: client.c,v 1.133 2001-11-22 11:04:48 adam Exp $ */ #include @@ -86,7 +86,7 @@ static CCL_bibset bibset; /* CCL bibset handle */ /* set this one to 1, to avoid decode of unknown MARCs */ -#define AVOID_MARC_DECODE 0 +#define AVOID_MARC_DECODE 1 void process_cmd_line(char* line); @@ -507,17 +507,24 @@ static void display_record(Z_DatabaseRecord *p) if ( #if AVOID_MARC_DECODE /* primitive check for a marc OID 5.1-29 */ - ent->oidsuffix[0] == 5 && ent->oidsuffix[1] < 30 && + ent->oidsuffix[0] == 5 && ent->oidsuffix[1] < 30 +#else + 1 #endif - marc_display_exl (octet_buf, NULL, 0 /* debug */, - p->u.octet_aligned->len) <= 0) + ) + { + if (marc_display_exl (octet_buf, NULL, 0 /* debug */, + p->u.octet_aligned->len) <= 0) + { + printf ("bad MARC. Dumping as it is:\n"); + print_record((const unsigned char*) octet_buf, + p->u.octet_aligned->len); + } + } + else { - printf ("Hmm.. doesn't look like a MARC.\n"); print_record((const unsigned char*) octet_buf, p->u.octet_aligned->len); - } else { - print_record((const unsigned char*) octet_buf, - p->u.octet_aligned->len); } } if (marcdump)