diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-07-06 17:57:42 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-07-06 17:57:42 +0000 |
commit | 7a985a18c2fee0aa9b490792dd990b75506e3740 (patch) | |
tree | 9e5e5e4f8ac3dc25855d13417d1196aa40d2630d /debugXML.c | |
parent | ffe4f5ec164ee30b0955584ef204a5ff0c413a8a (diff) | |
download | android_external_libxml2-7a985a18c2fee0aa9b490792dd990b75506e3740.tar.gz android_external_libxml2-7a985a18c2fee0aa9b490792dd990b75506e3740.tar.bz2 android_external_libxml2-7a985a18c2fee0aa9b490792dd990b75506e3740.zip |
fixed 2 bugs pointed in #116448 Daniel
* debugXML.c xpath.c: fixed 2 bugs pointed in #116448
Daniel
Diffstat (limited to 'debugXML.c')
-rw-r--r-- | debugXML.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -2104,7 +2104,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, while (1) { if (ctxt->node == (xmlNodePtr) ctxt->doc) snprintf(prompt, sizeof(prompt), "%s > ", "/"); - else if (ctxt->node->name) + else if ((ctxt->node != NULL) && (ctxt->node->name)) snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name); else snprintf(prompt, sizeof(prompt), "? > "); @@ -2329,6 +2329,13 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, if (list->nodesetval != NULL) { if (list->nodesetval->nodeNr == 1) { ctxt->node = list->nodesetval->nodeTab[0]; + if ((ctxt->node != NULL) && + (ctxt->node->type == + XML_NAMESPACE_DECL)) { + xmlGenericError(xmlGenericErrorContext, + "cannot cd to namespace\n"); + ctxt->node = NULL; + } } else xmlGenericError(xmlGenericErrorContext, "%s is a %d Node Set\n", |