summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2017-09-05 16:24:44 -0400
committerMike Gilbert <floppym@gentoo.org>2017-09-05 16:25:40 -0400
commit3a3329a4c5efc9282fb53096420270cf00aff660 (patch)
tree28e5763b0d701840184cd379d2524dca623763a2 /app-text/docbook-xsl-stylesheets/files
parentnet-libs/libtirpc: Add build fix for glibc-2.26, see bug 628752 (diff)
downloadgentoo-3a3329a4c5efc9282fb53096420270cf00aff660.tar.gz
gentoo-3a3329a4c5efc9282fb53096420270cf00aff660.tar.bz2
gentoo-3a3329a4c5efc9282fb53096420270cf00aff660.zip
app-text/docbook-xsl-stylesheets: apply nonrecursive-string-subst.patch
Patch taken from Debian. Bug: https://bugs.debian.org/765567 Bug: https://bugs.gentoo.org/630022 Package-Manager: Portage-2.3.6_p39, Repoman-2.3.3_p17
Diffstat (limited to 'app-text/docbook-xsl-stylesheets/files')
-rw-r--r--app-text/docbook-xsl-stylesheets/files/nonrecursive-string-subst.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/app-text/docbook-xsl-stylesheets/files/nonrecursive-string-subst.patch b/app-text/docbook-xsl-stylesheets/files/nonrecursive-string-subst.patch
new file mode 100644
index 000000000000..99ce9960d9e4
--- /dev/null
+++ b/app-text/docbook-xsl-stylesheets/files/nonrecursive-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">