fix subtle bug in title parsing - webdump - HTML to plain-text converter for webpages
HTML git clone git://git.codemadness.org/webdump
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 7491447d1bb2676212a7c4926023513ecb5e26e6
DIR parent 2a8072787382c43b838ca34313c6e5d7db442669
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 3 Jul 2026 23:00:19 +0200
fix subtle bug in title parsing
Make sure the ">" character is emitted so tag closing is handled in the parser.
test-case:
<title><![CDATA[test </title>]]>first title should be terminated.</title>
Diffstat:
M webdump.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/webdump.c b/webdump.c
@@ -453,7 +453,7 @@ pushback:
if (pushtagend) {
parser.getnext = getnext; /* restore */
getnext_literal_init(); /* reset */
- return '\0';
+ return '>'; /* end tag */
}
getnext_literal_init(); /* reset */
} else {
@@ -473,7 +473,7 @@ pushback:
pushend = pushbuf + strlen(endtagmatch) - 1; /* except NUL byte */
pushtagend = pushend; /* offset of where the tag ended */
}
- return '\0'; /* NUL byte (this should be ignored by the reader) */
+ goto pushback;
} else {
/* incomplete tag, fake incomplete leading "<" as data entity "<". */
if (ignorestate != endtagmatch) {