aboutsummaryrefslogtreecommitdiffstats
path: root/xmlcatalog.c
diff options
context:
space:
mode:
authorakirilov <akirilov@google.com>2018-06-01 13:46:04 -0700
committersyphyr <syphyr@gmail.com>2018-09-06 04:08:09 +0200
commit126c3993d2ad55db2abfe80e3d671bf584e7b13b (patch)
treef4464c225863c997e3f99d9897131f9f28df76fe /xmlcatalog.c
parent521b88fbb6d18312923f0df653d045384b500ffc (diff)
downloadandroid_external_libxml2-cm-13.0.tar.gz
android_external_libxml2-cm-13.0.tar.bz2
android_external_libxml2-cm-13.0.zip
Merge to pi-dev and restore Android.mk Bug: 79662501 Bug: 36809766 Bug: 36810305 Bug: 62151041 Test: manually verify functionality for regression Change-Id: Ife351c91c932eb92992656f8ea5c08724a220306 (cherry picked from commit 4e91cfdbb1a8624e5cd5a850d6e17da11d1e34a8)
Diffstat (limited to 'xmlcatalog.c')
-rw-r--r--xmlcatalog.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xmlcatalog.c b/xmlcatalog.c
index 006f0cc9..c02b97f6 100644
--- a/xmlcatalog.c
+++ b/xmlcatalog.c
@@ -312,7 +312,8 @@ static void usage(const char *name) {
/* split into 2 printf's to avoid overly long string (gcc warning) */
printf("\
Usage : %s [options] catalogfile entities...\n\
-\tParse the catalog file and query it for the entities\n\
+\tParse the catalog file (void specification possibly expressed as \"\"\n\
+\tappoints the default system one) and query it for the entities\n\
\t--sgml : handle SGML Super catalogs for --add and --del\n\
\t--shell : run a shell allowing interactive queries\n\
\t--create : create a new catalog\n\
@@ -408,11 +409,18 @@ int main(int argc, char **argv) {
continue;
} else if (argv[i][0] == '-')
continue;
- filename = argv[i];
+
+ if (filename == NULL && argv[i][0] == '\0') {
+ /* Interpret empty-string catalog specification as
+ a shortcut for a default system catalog. */
+ xmlInitializeCatalog();
+ } else {
+ filename = argv[i];
ret = xmlLoadCatalog(argv[i]);
if ((ret < 0) && (create)) {
xmlCatalogAdd(BAD_CAST "catalog", BAD_CAST argv[i], NULL);
}
+ }
break;
}