[xslt] behavior change in xsltParseStylesheetImportedDoc



I'm not sure if this was intended or not, but there is a behavior change within xsltParseStylesheetImportedDoc from the code refactoring.

In the old code section of the function, the return value from xsltParseStylesheetProcess is never tested and if it returned NULL, xsltParseStylesheetImportedDoc no longer returns NULL but rather a xsltStylesheetPtr. For instance if an empty doc were passed to xsltParseStylesheetImportedDoc NULL used to be returned returned.

Can someone let me know if this behavior change was by design otherwise attached is a patch to make it behave the old way.

Rob
Index: xslt.c
===================================================================
RCS file: /cvs/gnome/libxslt/libxslt/xslt.c,v
retrieving revision 1.136
diff -c -r1.136 xslt.c
*** xslt.c	26 Oct 2006 13:32:22 -0000	1.136
--- xslt.c	4 Dec 2006 18:31:04 -0000
***************
*** 6565,6571 ****
      * Old behaviour.
      */
      retStyle->doc = doc;
!     xsltParseStylesheetProcess(retStyle, doc);
      if (retStyle != NULL) {
  	if (retStyle->errors != 0) {
  	    retStyle->doc = NULL;
--- 6565,6575 ----
      * Old behaviour.
      */
      retStyle->doc = doc;
!     if (xsltParseStylesheetProcess(retStyle, doc) == NULL) {
! 		retStyle->doc = NULL;
! 		xsltFreeStylesheet(retStyle);
! 		retStyle = NULL;
!     }
      if (retStyle != NULL) {
  	if (retStyle->errors != 0) {
  	    retStyle->doc = NULL;


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