Commit a6825e8d authored by Daniel Veillard's avatar Daniel Veillard
Browse files

Heiko Rupp pointed that the shell would crash on empty nodesets returns.

* debugXML.c: Heiko Rupp pointed that the shell would crash
  on empty nodesets returns.
Daniel
parent 03f848d8
Wed Nov 7 14:32:55 CET 2001 Daniel Veillard <daniel@veillard.com>
* debugXML.c: Heiko Rupp pointed that the shell would crash
on empty nodesets returns.
Wed Nov 7 13:52:36 CET 2001 Daniel Veillard <daniel@veillard.com>
* Makefile.am: Weiqi Gao pointed out that xmlcatalog
......
......@@ -2038,6 +2038,9 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
case XPATH_NODESET:{
int indx;
if (list->nodesetval == NULL)
break;
for (indx = 0;
indx < list->nodesetval->nodeNr;
indx++) {
......@@ -2112,13 +2115,18 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
"%s: no such node\n", arg);
break;
case XPATH_NODESET:
if (list->nodesetval->nodeNr == 1) {
ctxt->node = list->nodesetval->nodeTab[0];
if (list->nodesetval != NULL) {
if (list->nodesetval->nodeNr == 1) {
ctxt->node = list->nodesetval->nodeTab[0];
} else
xmlGenericError(xmlGenericErrorContext,
"%s is a %d Node Set\n",
arg,
list->nodesetval->nodeNr);
} else
xmlGenericError(xmlGenericErrorContext,
"%s is a %d Node Set\n",
arg,
list->nodesetval->nodeNr);
"%s is an empty Node Set\n",
arg);
break;
case XPATH_BOOLEAN:
xmlGenericError(xmlGenericErrorContext,
......@@ -2183,6 +2191,9 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
case XPATH_NODESET:{
int indx;
if (list->nodesetval == NULL)
break;
for (indx = 0;
indx < list->nodesetval->nodeNr;
indx++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment