[libxml2] Make xmllint return an error if arguments are missing
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Make xmllint return an error if arguments are missing
- Date: Mon, 31 Jan 2022 13:47:28 +0000 (UTC)
commit eab86522163ec52602a020f62baa9f6cf87ec870
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Mon Jan 31 14:45:09 2022 +0100
Make xmllint return an error if arguments are missing
Before, xmllint would only return an error code if the argument
list was completely empty.
Fixes #285.
xmllint.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/xmllint.c b/xmllint.c
index 2c7b9d04..4ad80a0f 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -3134,7 +3134,7 @@ main(int argc, char **argv) {
if (argc <= 1) {
usage(stderr, argv[0]);
- return(1);
+ return(XMLLINT_ERR_UNCLASS);
}
/* xmlMemSetup must be called before initializing the parser. */
@@ -3504,7 +3504,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "Unknown option %s\n", argv[i]);
usage(stderr, argv[0]);
- return(1);
+ return(XMLLINT_ERR_UNCLASS);
}
}
@@ -3787,6 +3787,7 @@ main(int argc, char **argv) {
}
if ((files == 0) && (!generate) && (version == 0)) {
usage(stderr, argv[0]);
+ progresult = XMLLINT_ERR_UNCLASS;
}
#ifdef LIBXML_SCHEMATRON_ENABLED
if (wxschematron != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]