Erich E. Hoover : hhctrl.ocx: Permit HTML start/ end tags within quoted attributes.
Module: wine Branch: master Commit: ee484b3140ee7637f297ed8ed4af86dd1e626416 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ee484b3140ee7637f297ed8ed4... Author: Erich E. Hoover <erich.e.hoover(a)gmail.com> Date: Tue Feb 25 19:20:31 2014 -0700 hhctrl.ocx: Permit HTML start/end tags within quoted attributes. --- dlls/hhctrl.ocx/stream.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/dlls/hhctrl.ocx/stream.c b/dlls/hhctrl.ocx/stream.c index eb2bcc3..4dc9645 100644 --- a/dlls/hhctrl.ocx/stream.c +++ b/dlls/hhctrl.ocx/stream.c @@ -110,12 +110,52 @@ BOOL next_content(stream_t *stream, strbuf_t *buf) return TRUE; } +static BOOL find_node_end(stream_t *stream, strbuf_t *buf) +{ + int tag_count = 0, b = buf->len; + char *p; + + while(1) + { + if(!stream_chr(stream, buf, '>')) + return FALSE; + if(buf->len == 0) + break; + p = &buf->buf[b]; + while((p = memchr(p+1, '"', buf->len-(p-buf->buf))) != NULL) + tag_count++; + b = buf->len; + if(tag_count % 2 != 0) + { + if(!stream_chr(stream, buf, '"')) + return FALSE; + tag_count++; + } + else + break; + } + return TRUE; +} + BOOL next_node(stream_t *stream, strbuf_t *buf) { + strbuf_t tmpbuf; + + /* search through the end of the current node */ + strbuf_init(&tmpbuf); + if(!find_node_end(stream, &tmpbuf)) + { + strbuf_free(buf); + return FALSE; + } + strbuf_free(&tmpbuf); + + /* find the beginning of the next node */ if(!stream_chr(stream, NULL, '<')) return FALSE; - if(!stream_chr(stream, buf, '>')) + /* read out the data of the next node */ + if(!find_node_end(stream, buf)) return FALSE; strbuf_append(buf, ">", 2);
participants (1)
-
Alexandre Julliard