Commit 5e8fb617 authored by Nikias Bassen's avatar Nikias Bassen

xplist: Fix parsing of adjacent nodes without whitespace between them

The context position counter was increased after encountering a closing
node, e.g. '</dict>' or after a closing '</key>' node. When a node followed
it directly without any whitespace inbetween, e.g. </dict><key>, parsing
would fail since the parser would look at 'key>' instead of '<key>' for the
next node to be parsed.
parent 950b6ddc
......@@ -621,6 +621,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist)
if (*ctx->pos != '<') {
PLIST_XML_ERR("Failed to parse XML. Expected: opening tag, found: '%s', pos: %s\n", start, ctx->pos);
ctx->pos = ctx->end;
ctx->err++;
break;
}
ctx->pos++;
......@@ -828,7 +829,6 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist)
free(tag);
plist_free(subnode);
subnode = NULL;
ctx->pos++;
continue;
} else {
data->strval = str;
......@@ -953,7 +953,6 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist)
break;
}
}
ctx->pos++;
}
if (ctx->err) {
plist_free(*plist);
......
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