diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-10-19 02:47:30 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-10-19 02:51:14 +0200 |
commit | e85f9b98a5389c69167176ae6600091e719ec38f (patch) | |
tree | afec3a8ce263f1b28fe0d58ac72888b44964a8eb /xmllint.c | |
parent | 530938b4870192d51fd0f01e564c12acc0f7acac (diff) | |
download | libxml2-e85f9b98a5389c69167176ae6600091e719ec38f.tar.gz |
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.
Diffstat (limited to 'xmllint.c')
-rw-r--r-- | xmllint.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |