1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-02-04 01:47:02 +03:00

xmllint: Improve handling of empty XPath node sets

Don't return an error if the result is an empty node set. Suppress the
"XPath set is empty" message in quiet mode.

Fixes #180.
This commit is contained in:
Nick Wellnhofer 2022-10-19 02:47:30 +02:00
parent 530938b487
commit e85f9b98a5

View File

@ -2022,8 +2022,9 @@ static void doXPathDump(xmlXPathObjectPtr cur) {
xmlOutputBufferPtr buf;
if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr <= 0)) {
fprintf(stderr, "XPath set is empty\n");
progresult = XMLLINT_ERR_XPATH;
if (!quiet) {
fprintf(stderr, "XPath set is empty\n");
}
break;
}
buf = xmlOutputBufferCreateFile(stdout, NULL);