[libxml2] XMl Shell command "cd" does not handle "/" at end of path



commit 23243301a68ac56cc5dbfdcf2271589bd46fa71c
Author: Daniel Veillard <veillard redhat com>
Date:   Mon Jul 14 17:59:31 2014 +0800

    XMl Shell command "cd" does not handle "/" at end of path
    
    For https://bugzilla.gnome.org/show_bug.cgi?id=731832
    small fix

 debugXML.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/debugXML.c b/debugXML.c
index 8aab703..b05fdff 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -3243,7 +3243,12 @@ 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]