mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-07-31 02:43:06 +03:00
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.
This commit is contained in:
committed by
Daniel Veillard
parent
a2051bf912
commit
e669a8c7ce
@ -359,16 +359,23 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
|
|||||||
|
|
||||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||||
if (xinclude) {
|
if (xinclude) {
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (timing)
|
if (timing)
|
||||||
startTimer();
|
startTimer();
|
||||||
#if LIBXML_VERSION >= 20603
|
#if LIBXML_VERSION >= 20603
|
||||||
xmlXIncludeProcessFlags(doc, XSLT_PARSE_OPTIONS);
|
ret = xmlXIncludeProcessFlags(doc, XSLT_PARSE_OPTIONS);
|
||||||
#else
|
#else
|
||||||
xmlXIncludeProcess(doc);
|
ret = xmlXIncludeProcess(doc);
|
||||||
#endif
|
#endif
|
||||||
if (timing) {
|
if (timing) {
|
||||||
endTimer("XInclude processing %s", filename);
|
endTimer("XInclude processing %s", filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret < 0) {
|
||||||
|
errorno = 6;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (timing)
|
if (timing)
|
||||||
|
Reference in New Issue
Block a user