fixed two problems related to checking of fragments, related to python
authorWilliam M. Brack <wbrack@src.gnome.org>
Mon, 15 Jan 2007 02:49:25 +0000 (02:49 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Mon, 15 Jan 2007 02:49:25 +0000 (02:49 +0000)
* libxslt/functions.c: fixed two problems related to checking
  of fragments, related to python htmlCtxtReadFile problem
  reported on mailing list by Nic Ferrier.

svn path=/trunk/; revision=1417

ChangeLog
libxslt/functions.c

index bb3ed28..e4e52f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Jan 14 18:45:08 PST 2007 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/functions.c: fixed two problems related to checking
+         of fragments, related to python htmlCtxtReadFile problem
+         reported on mailing list by Nic Ferrier.
+
 Fri Jan 12 23:24:08 PST 2007 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/extensions.c: reverted last change, fixed some
index 9e120a9..7ae2499 100644 (file)
@@ -133,10 +133,11 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
      */
     fragment = (xmlChar *)uri->fragment;
     if (fragment != NULL) {
+        xmlChar *newURI;
        uri->fragment = NULL;
-       URI = xmlSaveUri(uri);
-       idoc = xsltLoadDocument(tctxt, URI);
-       xmlFree(URI);
+       newURI = xmlSaveUri(uri);
+       idoc = xsltLoadDocument(tctxt, newURI);
+       xmlFree(newURI);
     } else
        idoc = xsltLoadDocument(tctxt, URI);
     xmlFreeURI(uri);
@@ -144,7 +145,8 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
     if (idoc == NULL) {
        if ((URI == NULL) ||
            (URI[0] == '#') ||
-           (xmlStrEqual(tctxt->style->doc->URL, URI))) 
+           ((tctxt->style->doc != NULL) &&
+           (xmlStrEqual(tctxt->style->doc->URL, URI)))) 
        {
            /*
            * This selects the stylesheet's doc itself.