From 9c6eebac17a12f28b4e81410d94013c26e90fae1 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Fri, 20 Jun 2025 22:22:03 +0200 Subject: [PATCH] xmllint: Fix --xinclude --path Use resource loader for XInclude. Regressed with f96dca9c. --- xmllint.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xmllint.c b/xmllint.c index 3c6680e47..3c80deab6 100644 --- a/xmllint.c +++ b/xmllint.c @@ -1792,13 +1792,27 @@ parseAndPrintFile(xmllintState *lint, const char *filename) { #ifdef LIBXML_XINCLUDE_ENABLED if (lint->xinclude) { + xmlXIncludeCtxt *xinc; + int res; + if ((lint->timing) && (lint->repeat == 1)) { startTimer(lint); } - if (xmlXIncludeProcessFlags(doc, lint->options) < 0) { + + xinc = xmlXIncludeNewContext(doc); + if (xinc == NULL) { + lint->progresult = XMLLINT_ERR_MEM; + goto done; + } + xmlXIncludeSetResourceLoader(xinc, xmllintResourceLoader, lint); + xmlXIncludeSetFlags(xinc, lint->options); + res = xmlXIncludeProcessNode(xinc, (xmlNode *) doc); + xmlXIncludeFreeContext(xinc); + if (res < 0) { lint->progresult = XMLLINT_ERR_UNCLASS; goto done; } + if ((lint->timing) && (lint->repeat == 1)) { endTimer(lint, "Xinclude processing"); }