fixed problem with housekeeping of localRVTBase, bug #378766
authorWilliam M. Brack <wbrack@src.gnome.org>
Fri, 1 Dec 2006 16:02:14 +0000 (16:02 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Fri, 1 Dec 2006 16:02:14 +0000 (16:02 +0000)
* libxslt/transform.c: fixed problem with housekeeping of
  localRVTBase, bug #378766

ChangeLog
libxslt/transform.c

index fa5233a..92252ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Dec  1 23:02:27 HKT 2006 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c: fixed problem with housekeeping of
+         localRVTBase, bug #378766
+
 Wed Nov 29 16:06:43 CET 2006 Daniel Veillard <daniel@veillard.com>
 
        * NEWS configure.in doc//*: preparing release of libxslt-1.1.19
index 95f598a..1c4f5c7 100644 (file)
@@ -2118,14 +2118,14 @@ xsltReleaseLocalRVTs(xsltTransformContextPtr ctxt, xmlDocPtr base)
            cur = (xmlDocPtr) cur->next;
 
            if (tmp == ctxt->localRVT)
-               ctxt->localRVT = (xmlDocPtr) tmp->next;
+               ctxt->localRVT = cur;
 
            /*
            * We need ctxt->localRVTBase for extension instructions
            * which return values (like EXSLT's function).
            */
            if (tmp == ctxt->localRVTBase)
-               ctxt->localRVTBase = (xmlDocPtr) tmp->next;
+               ctxt->localRVTBase = cur;
 
            if (tmp->prev)
                tmp->prev->next = (xmlNodePtr) cur;
@@ -3032,6 +3032,9 @@ xsltApplyXSLTTemplate(xsltTransformContextPtr ctxt,
        do {
            tmp = curdoc;
            curdoc = (xmlDocPtr) curdoc->next;
+           /* Need to housekeep localRVTBase */
+           if (tmp == ctxt->localRVTBase)
+               ctxt->localRVTBase = curdoc;
            xsltReleaseRVT(ctxt, tmp);
        } while (curdoc != oldLocalFragmentTop);
     }