docbook-xsl-nons-1.79.2-stack_fix-1.patch (1744B)
1 Submitted By: Bruce Dubbs <bdubbs at linuxfromscratch dot org> 2 Date: 2018-01-01 3 Initial Package Version: 1.78.1 4 Upstream Status: Unsure 5 Origin: Peter De Wachter <pdewacht@gmail.com> 6 Description: use EXSLT "replace" function when available 7 A recursive implementation of string.subst is problematic, 8 long strings with many matches will cause stack overflows. 9 Author: Peter De Wachter <pdewacht@gmail.com> 10 Bug-Debian: https://bugs.debian.org/750593 11 12 Rediffed for 1.79.2 by Bruce Dubbs 13 14 diff -Naur docbook-xsl-1.79.2.orig/lib/lib.xsl docbook-xsl-1.79.2/lib/lib.xsl 15 --- docbook-xsl-1.79.2.orig/lib/lib.xsl 2016-12-09 16:41:39.000000000 -0600 16 +++ docbook-xsl-1.79.2/lib/lib.xsl 2018-01-01 12:54:52.507332514 -0600 17 @@ -6,7 +6,11 @@ 18 19 This module implements DTD-independent functions 20 21 - ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 22 + ******************************************************************** --> 23 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 24 + xmlns:str="http://exslt.org/strings" 25 + exclude-result-prefixes="str" 26 + version="1.0"> 27 28 <xsl:template name="dot.count"> 29 <!-- Returns the number of "." characters in a string --> 30 @@ -52,6 +56,9 @@ 31 <xsl:param name="replacement"/> 32 33 <xsl:choose> 34 + <xsl:when test="function-available('str:replace')"> 35 + <xsl:value-of select="str:replace($string, string($target), string($replacement))"/> 36 + </xsl:when> 37 <xsl:when test="contains($string, $target)"> 38 <xsl:variable name="rest"> 39 <xsl:call-template name="string.subst">