summaryrefslogtreecommitdiff
path: root/debugXML.c
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2015-08-25 21:55:55 +0200
committerRaphaël Hertzog <hertzog@debian.org>2015-08-25 21:55:55 +0200
commit21ee18bdbc9a9d4500e12a1399d51c593b8b31d4 (patch)
tree35c498d3ec731bcf7b90ce66bce68ecd54659250 /debugXML.c
parentde338c1adfa336ddb5177ceb5c63bcd868a0ebc7 (diff)
parent7300193becde71a344c8ac0973dc290fa24d800d (diff)
downloadlibxml2-21ee18bdbc9a9d4500e12a1399d51c593b8b31d4.tar.gz
Merge tag 'upstream/2.9.1+dfsg1'
Upstream version 2.9.1+dfsg1
Diffstat (limited to 'debugXML.c')
-rw-r--r--debugXML.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/debugXML.c b/debugXML.c
index b05fdff..c8efe6a 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -254,12 +254,10 @@ xmlCtxtCheckName(xmlDebugCtxtPtr ctxt, const xmlChar * name)
xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL");
return;
}
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
if (xmlValidateName(name, 0)) {
xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME,
"Name is not an NCName '%s'", (const char *) name);
}
-#endif
if ((ctxt->dict != NULL) &&
(!xmlDictOwns(ctxt->dict, name)) &&
((ctxt->doc == NULL) ||
@@ -2948,7 +2946,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
} else if (!strcmp(command, "save")) {
xmlShellSave(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "write")) {
- if (arg[0] == 0)
+ if ((arg == NULL) || (arg[0] == 0))
xmlGenericError(xmlGenericErrorContext,
"Write command requires a filename argument\n");
else
@@ -3243,12 +3241,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
ctxt->node = (xmlNodePtr) ctxt->doc;
} else {
#ifdef LIBXML_XPATH_ENABLED
- int l;
-
ctxt->pctxt->node = ctxt->node;
- l = strlen(arg);
- if ((l >= 2) && (arg[l - 1] == '/'))
- arg[l - 1] = 0;
list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
#else
list = NULL;