components/libxslt/patches/10-libxslt-xsltproc-should-return-an-error-code-if-xinclude-fails.patch
branchs11u1-sru
changeset 2471 b1f0e4a84df6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libxslt/patches/10-libxslt-xsltproc-should-return-an-error-code-if-xinclude-fails.patch	Mon Jan 21 03:30:38 2013 -0800
@@ -0,0 +1,48 @@
+Taken as it's from:
+
+http://git.gnome.org/browse/libxslt/commit/?id=e669a8c7cefec93ee1bfaf59721aadc42e226d6e
+
+From e669a8c7cefec93ee1bfaf59721aadc42e226d6e Mon Sep 17 00:00:00 2001
+From: Malcolm Purvis <[email protected]>
+Date: Thu, 16 Aug 2012 09:08:31 +0000
+Subject: xsltproc should return an error code if xinclude fails
+
+When running xsltproc with the --xinclude option and if the included file
+contains parse errors, then xsltproc exits with a success return code (0)
+rather than an error code.  This is despite the fact that parser error
+messages are printed out.
+* xsltproc/xsltproc.c: check xinclude processing function return code,
+  fail with error 6 if it went wrong.
+---
+diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
+index 8244ef3..42d6b9a 100644
+--- a/xsltproc/xsltproc.c
++++ b/xsltproc/xsltproc.c
+@@ -359,16 +359,23 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
+ 
+ #ifdef LIBXML_XINCLUDE_ENABLED
+     if (xinclude) {
++        int ret;
++
+ 	if (timing)
+ 	    startTimer();
+ #if LIBXML_VERSION >= 20603
+-	xmlXIncludeProcessFlags(doc, XSLT_PARSE_OPTIONS);
++	ret = xmlXIncludeProcessFlags(doc, XSLT_PARSE_OPTIONS);
+ #else
+-	xmlXIncludeProcess(doc);
++	ret = xmlXIncludeProcess(doc);
+ #endif
+ 	if (timing) {
+ 	    endTimer("XInclude processing %s", filename);
+ 	}
++
++        if (ret < 0) {
++	    errorno = 6;
++            return;
++        }
+     }
+ #endif
+     if (timing)
+--
+cgit v0.9.0.2