diff options
author | Malcolm Purvis <malcolm@purvis.id.au> | 2012-08-16 17:08:31 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-08-16 17:08:31 +0800 |
commit | e669a8c7cefec93ee1bfaf59721aadc42e226d6e (patch) | |
tree | aa525b0374960f28d82651dcc42c2e996b1d9fc4 | |
parent | a2051bf912d8e96e5b7407fde237cfbdc590ce1e (diff) | |
download | libxslt-e669a8c7cefec93ee1bfaf59721aadc42e226d6e.tar.gz libxslt-e669a8c7cefec93ee1bfaf59721aadc42e226d6e.tar.bz2 libxslt-e669a8c7cefec93ee1bfaf59721aadc42e226d6e.zip |
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.
-rw-r--r-- | xsltproc/xsltproc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index 8244ef3a..42d6b9aa 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) |