1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-23 02:50:08 +03:00

tried to fix some of the problem with --sgml Daniel

* xmlcatalog.c: tried to fix some of the problem with --sgml
Daniel
This commit is contained in:
Daniel Veillard 2002-10-22 14:23:59 +00:00
parent 935494a10e
commit 9cdcf36e70
2 changed files with 14 additions and 6 deletions

@ -1,3 +1,7 @@
Tue Oct 22 16:23:57 CEST 2002 Daniel Veillard <daniel@veillard.com>
* xmlcatalog.c: tried to fix some of the problem with --sgml
Mon Oct 21 09:57:10 CEST 2002 Daniel Veillard <daniel@veillard.com>
* parser.c: tried to fix bug #91500 where doc->children may

@ -210,11 +210,17 @@ static void usershell(void) {
}
} else if (!strcmp(command, "add")) {
if (sgml) {
if (nbargs != 1) {
printf("add requires 1 argument\n");
if ((nbargs != 3) && (nbargs != 2)) {
printf("add requires 2 or 3 arguments\n");
} else {
ret = xmlCatalogAdd(BAD_CAST "sgmlcatalog", NULL,
BAD_CAST argv[0]);
if (argv[2] == NULL)
ret = xmlCatalogAdd(BAD_CAST argv[0], NULL,
BAD_CAST argv[1]);
else
ret = xmlCatalogAdd(BAD_CAST argv[0], BAD_CAST argv[1],
BAD_CAST argv[2]);
if (ret != 0)
printf("add command failed\n");
}
} else {
if ((nbargs != 3) && (nbargs != 2)) {
@ -382,12 +388,10 @@ int main(int argc, char **argv) {
} else if (argv[i][0] == '-')
continue;
filename = argv[i];
if (!sgml) {
ret = xmlLoadCatalog(argv[i]);
if ((ret < 0) && (create)) {
xmlCatalogAdd(BAD_CAST "catalog", BAD_CAST argv[i], NULL);
}
}
break;
}