From d8bf5f7a48d0abb1db4bcb6ffceb74f2df8eae76 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 22 Nov 2001 11:04:48 +0000 Subject: [PATCH] Fixed dup display of records (bug introduced by previous commit). --- client/client.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) 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) -- 1.7.10.4