From 9c0401b44ce62a030b9968ccbf7a5b445b2ab506 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 26 Nov 2004 11:01:05 +0000 Subject: [PATCH] yaz-log.7 man pages part of RedHat package yaz --- src/marcdisp.c | 24 +++++++++++++++++++++--- yaz.spec.in | 1 + 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/marcdisp.c b/src/marcdisp.c index 1b02e11..e42080a 100644 --- a/src/marcdisp.c +++ b/src/marcdisp.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: marcdisp.c,v 1.9 2004-11-25 09:43:10 adam Exp $ + * $Id: marcdisp.c,v 1.10 2004-11-26 11:01:05 adam Exp $ */ /** @@ -95,7 +95,17 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) base_address = atoi_n (buf+12, 5); length_data_entry = atoi_n (buf+20, 1); + if (buf[20] <= '0' || buf[20] >= '9') + { + wrbuf_printf(wr, "\n"); + length_data_entry = 4; + } length_starting = atoi_n (buf+21, 1); + if (buf[21] <= '0' || buf[21] >= '9') + { + wrbuf_printf(wr, "\n"); + length_starting = 5; + } length_implementation = atoi_n (buf+22, 1); if (mt->xml != YAZ_MARC_LINE) @@ -248,9 +258,11 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) int i, j; char tag[4]; int identifier_flag = 0; + int entry_p0; memcpy (tag, buf+entry_p, 3); entry_p += 3; + entry_p0 = entry_p; tag[3] = '\0'; data_length = atoi_n (buf+entry_p, length_data_entry); entry_p += length_data_entry; @@ -259,6 +271,12 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) i = data_offset + base_address; end_offset = i+data_length-1; + if (mt->debug) + { + wrbuf_printf(wr, "\n", + entry_p0, data_length, data_offset); + } + if (indicator_length < 4 && indicator_length > 0) { if (buf[i + indicator_length] == ISO2709_IDFS) @@ -409,9 +427,9 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) if (mt->xml == YAZ_MARC_LINE) wrbuf_putc (wr, '\n'); if (i < end_offset) - wrbuf_puts (wr, " \n"); + wrbuf_printf(wr, " \n", data_length); if (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS) - wrbuf_puts (wr, " \n"); + wrbuf_printf(wr, " \n", data_length); switch(mt->xml) { case YAZ_MARC_SIMPLEXML: diff --git a/yaz.spec.in b/yaz.spec.in index 9b4deb0..f425520 100644 --- a/yaz.spec.in +++ b/yaz.spec.in @@ -62,6 +62,7 @@ rm -fr ${RPM_BUILD_ROOT} /usr/share/man/man1/zoomsh.* /usr/share/man/man1/yaz-marcdump.* /usr/share/man/man1/yaz-iconv.* +/usr/share/man/man7/yaz-log.* %files -n lib%{name} /usr/lib/*.so.* -- 1.7.10.4