]> git.pld-linux.org Git - packages/docbook-style-xsl.git/commitdiff
- rel 2; avoid recursion (from FC) auto/th/docbook-style-xsl-1.79.2-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 5 Nov 2017 15:41:46 +0000 (16:41 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 5 Nov 2017 15:41:46 +0000 (16:41 +0100)
docbook-style-xsl-non-recursive-string-subst.patch [new file with mode: 0644]
docbook-style-xsl.spec

diff --git a/docbook-style-xsl-non-recursive-string-subst.patch b/docbook-style-xsl-non-recursive-string-subst.patch
new file mode 100644 (file)
index 0000000..ed302a9
--- /dev/null
@@ -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
+
+--- docbook-xsl-1.78.1+dfsg.orig/docbook-xsl/lib/lib.xsl
++++ docbook-xsl-1.78.1+dfsg/docbook-xsl/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">
index 335cc1185c237928817f601661781a390ef6fba8..858c2f4f2d66a2a06bad8b21663fb363efbc1cd8 100644 (file)
@@ -9,13 +9,14 @@ Summary(pl.UTF-8):    Arkusze stylów XSL dla DocBooka
 Summary(pt_BR.UTF-8):  Stylesheets modulares do Norman Walsh para DocBook
 Name:          docbook-style-xsl
 Version:       1.79.2
-Release:       1
+Release:       2
 License:       MIT-like
 Group:         Applications/Publishing/XML
 Source0:       https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{version}/docbook-xsl-%{version}.tar.bz2
 # Source0-md5: 4a400f0264a19329c7f95f69e098744a
 Source1:       https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{version}/docbook-xsl-doc-%{version}.tar.bz2
 # Source1-md5: 62375ca864fc198cb2b17d98209d0b8c
+Patch0:                docbook-style-xsl-non-recursive-string-subst.patch
 URL:           https://github.com/docbook/xslt10-stylesheets
 BuildRequires: libxml2-progs
 BuildRequires: unzip
@@ -83,6 +84,7 @@ Rozszerzenia DocBook Saxon.
 
 %prep
 %setup -q -n docbook-xsl-%{version} -b1
+%patch0 -p2
 
 %install
 rm -rf $RPM_BUILD_ROOT
This page took 0.074768 seconds and 4 git commands to generate.