From 7946f2f0550251b1e876662c6f31bf6190c9f3bc Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 2 Jan 2017 00:17:23 +0100 Subject: xplist: Allow whitespace after name in closing tag '' is a perfectly valid closing tag and so is '' (note the newline). This commit will make the parser skip any encountered whitespace before checking for the closing '>'. --- src/xplist.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xplist.c b/src/xplist.c index 11b7400..d15f52d 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -607,8 +607,13 @@ static text_part_t* get_text_parts(parse_ctx ctx, const char* tag, size_t tag_le return NULL; } ctx->pos+=tag_len; - if (ctx->pos >= ctx->end || *ctx->pos != '>') { - PLIST_XML_ERR("EOF or no '>' after tag name\n"); + parse_skip_ws(ctx); + if (ctx->pos >= ctx->end) { + PLIST_XML_ERR("EOF while parsing closing tag\n"); + ctx->err++; + return NULL; + } else if (*ctx->pos != '>') { + PLIST_XML_ERR("Invalid closing tag; expected '>', found '%c'\n", *ctx->pos); ctx->err++; return NULL; } -- cgit v1.1-32-gdbae