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:
parent
530938b487
commit
e85f9b98a5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user