Commit 51172e24 authored by Leonardo Arena's avatar Leonardo Arena
Browse files

main/docbook-xsl: fix bus error on some arches

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750593
parent ca541a5d
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">
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=docbook-xsl
pkgver=1.79.1
pkgrel=0
pkgrel=1
pkgdesc="XML stylesheets for Docbook-xml transformations."
url="http://docbook.sourceforge.net/"
arch="noarch"
......@@ -10,7 +10,9 @@ depends="libxml2-utils libxslt docbook-xml"
makedepends=""
options="!check"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.post-deinstall"
source="http://downloads.sourceforge.net/sourceforge/docbook/$pkgname-$pkgver.tar.bz2"
source="http://downloads.sourceforge.net/sourceforge/docbook/$pkgname-$pkgver.tar.bz2
765567_non-recursive_string_subst.patch
"
build() {
return 0
......@@ -41,6 +43,5 @@ package() {
"$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
md5sums="b48cbf929a2ad85e6672f710777ca7bc docbook-xsl-1.79.1.tar.bz2"
sha256sums="725f452e12b296956e8bfb876ccece71eeecdd14b94f667f3ed9091761a4a968 docbook-xsl-1.79.1.tar.bz2"
sha512sums="83325cbaf1545da6b9b8b77f5f0e6fdece26e3c455164b300a1aa3d19e3bd29ae71fd563553a714a5394968d1a65684c6c7987c77524469358d18b8c227025c7 docbook-xsl-1.79.1.tar.bz2"
sha512sums="83325cbaf1545da6b9b8b77f5f0e6fdece26e3c455164b300a1aa3d19e3bd29ae71fd563553a714a5394968d1a65684c6c7987c77524469358d18b8c227025c7 docbook-xsl-1.79.1.tar.bz2
6a26838078a3ce28273dddfa1af6a378cffc28b6d1ba48a4cfc839addd7bf58ce217d6584b735f9c75381954744ab2386c75fa3c593858b6e27882be55c00d04 765567_non-recursive_string_subst.patch"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment