Commit 7946f2f0 authored by Nikias Bassen's avatar Nikias Bassen

xplist: Allow whitespace after name in closing tag

'</key >' is a perfectly valid closing tag and so is
'</key
 >' (note the newline).
This commit will make the parser skip any encountered whitespace
before checking for the closing '>'.
parent c2ea55aa
...@@ -607,8 +607,13 @@ static text_part_t* get_text_parts(parse_ctx ctx, const char* tag, size_t tag_le ...@@ -607,8 +607,13 @@ static text_part_t* get_text_parts(parse_ctx ctx, const char* tag, size_t tag_le
return NULL; return NULL;
} }
ctx->pos+=tag_len; ctx->pos+=tag_len;
if (ctx->pos >= ctx->end || *ctx->pos != '>') { parse_skip_ws(ctx);
PLIST_XML_ERR("EOF or no '>' after tag name\n"); 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++; ctx->err++;
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment