summaryrefslogtreecommitdiff
path: root/debugXML.c
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2015-08-25 21:55:54 +0200
committerRaphaël Hertzog <hertzog@debian.org>2015-08-25 21:55:54 +0200
commit7300193becde71a344c8ac0973dc290fa24d800d (patch)
tree6490c364e7764294c209e536d42f3d31d23ebc0d /debugXML.c
parent3871a83a5f0aebd8c00879eab14fe901c93dbfcf (diff)
downloadlibxml2-7300193becde71a344c8ac0973dc290fa24d800d.tar.gz
Imported 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;