summaryrefslogtreecommitdiff
path: root/system/docbook-xsl/765567_non-recursive_string_subst.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-25 06:09:52 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-25 06:09:52 -0500
commit9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538 (patch)
tree713006b36e1b03f3b4ea559b59808f0f3f20f001 /system/docbook-xsl/765567_non-recursive_string_subst.patch
parent41248e0f93acf525137df8b42c0e00a5e4a5c773 (diff)
downloadpackages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.tar.gz
packages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.tar.bz2
packages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.tar.xz
packages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.zip
system/docbook-xsl: pull in for xmlto
Diffstat (limited to 'system/docbook-xsl/765567_non-recursive_string_subst.patch')
-rw-r--r--system/docbook-xsl/765567_non-recursive_string_subst.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/system/docbook-xsl/765567_non-recursive_string_subst.patch b/system/docbook-xsl/765567_non-recursive_string_subst.patch
new file mode 100644
index 000000000..99ce9960d
--- /dev/null
+++ b/system/docbook-xsl/765567_non-recursive_string_subst.patch
@@ -0,0 +1,30 @@
+Description: use EXSLT "replace" function when available
+ A recursive implementation of string.subst is problematic,
+ long strings with many matches will cause stack overflows.
+Author: Peter De Wachter <pdewacht@gmail.com>
+Bug-Debian: https://bugs.debian.org/750593
+
+--- a/lib/lib.xsl
++++ b/lib/lib.xsl
+@@ -10,7 +10,10 @@
+ This module implements DTD-independent functions
+
+ ******************************************************************** -->
+-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
++<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
++ xmlns:str="http://exslt.org/strings"
++ exclude-result-prefixes="str"
++ version="1.0">
+
+ <xsl:template name="dot.count">
+ <!-- Returns the number of "." characters in a string -->
+@@ -56,6 +59,9 @@
+ <xsl:param name="replacement"/>
+
+ <xsl:choose>
++ <xsl:when test="function-available('str:replace')">
++ <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>
++ </xsl:when>
+ <xsl:when test="contains($string, $target)">
+ <xsl:variable name="rest">
+ <xsl:call-template name="string.subst">