From: Adam Dickmeiss Date: Tue, 27 Mar 2001 23:06:21 +0000 (+0000) Subject: Quotes and slashes may occur within attributes. X-Git-Tag: YAZ.1.8~99 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=09405de098947fc5f359e9bd1225b2747596b513;hp=fb36df3c32d9023ca55f8050ea4128f42d2dfc34 Quotes and slashes may occur within attributes. --- diff --git a/retrieval/d1_read.c b/retrieval/d1_read.c index 78b7cdd..0af7492 100644 --- a/retrieval/d1_read.c +++ b/retrieval/d1_read.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_read.c,v $ - * Revision 1.37 2001-02-28 09:00:06 adam + * Revision 1.38 2001-03-27 23:06:21 adam + * Quotes and slashes may occur within attributes. + * + * Revision 1.37 2001/02/28 09:00:06 adam * Fixed problem with stack overflow for very nested records. * * Revision 1.36 2001/02/21 13:46:53 adam @@ -373,19 +376,30 @@ data1_xattr *data1_read_xattr (data1_handle dh, NMEM m, { c = (*get_byte)(fh); if (c == '"') - c = (*get_byte)(fh); - wrbuf_rewind(wrbuf); - while (c && c != '"' && c != '>' && c != '/') { - wrbuf_putc (wrbuf, c); - c = (*get_byte)(fh); + c = (*get_byte)(fh); + wrbuf_rewind(wrbuf); + while (c && c != '"') + { + wrbuf_putc (wrbuf, c); + c = (*get_byte)(fh); + } + if (c) + c = (*get_byte)(fh); } + else + { + wrbuf_rewind(wrbuf); + while (c && c != '>' && c != '/') + { + wrbuf_putc (wrbuf, c); + c = (*get_byte)(fh); + } + } wrbuf_putc (wrbuf, '\0'); len = wrbuf_len(wrbuf); p->value = (char*) nmem_malloc (m, len); strcpy (p->value, wrbuf_buf(wrbuf)); - if (c == '"') - c = (*get_byte)(fh); } } *ch = c;