From 09405de098947fc5f359e9bd1225b2747596b513 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 27 Mar 2001 23:06:21 +0000 Subject: [PATCH] Quotes and slashes may occur within attributes. --- retrieval/d1_read.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) 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; -- 1.7.10.4