From 906a5ab4a9c3b8b9a4bef15de1df58ab873a1cb5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 2 Oct 2002 15:51:52 +0000 Subject: [PATCH] Create entities for MARC data (& <) --- util/marcdisp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/util/marcdisp.c b/util/marcdisp.c index 840c0b1..8133832 100644 --- a/util/marcdisp.c +++ b/util/marcdisp.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2002, Index Data * See the file LICENSE for details. * - * $Id: marcdisp.c,v 1.19 2002-03-18 18:11:45 adam Exp $ + * $Id: marcdisp.c,v 1.20 2002-10-02 15:51:52 adam Exp $ */ #if HAVE_CONFIG_H @@ -192,7 +192,12 @@ int yaz_marc_decode (const char *buf, WRBUF wr, int debug, int bsize, int xml) while (buf[i] != ISO2709_RS && buf[i] != ISO2709_IDFS && buf[i] != ISO2709_FS && i < end_offset) { - wrbuf_putc (wr, buf[i]); + if (xml && buf[i] == '<') + wrbuf_puts(wr, "<"); + else if (xml && buf[i] == '&') + wrbuf_puts(wr, "&"); + else + wrbuf_putc (wr, buf[i]); i++; } if (xml) @@ -200,7 +205,12 @@ int yaz_marc_decode (const char *buf, WRBUF wr, int debug, int bsize, int xml) } else { - wrbuf_putc (wr, buf[i]); + if (xml && buf[i] == '<') + wrbuf_puts(wr, "<"); + else if (xml && buf[i] == '&') + wrbuf_puts(wr, "&"); + else + wrbuf_putc (wr, buf[i]); i++; } } -- 1.7.10.4