summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Klinkovsk√Ĺ2020-08-18 13:18:15 +0200
committerJakub Klinkovsk√Ĺ2020-08-18 13:18:15 +0200
commit7771e33eca7be83b17e58caa5500987da71f75b6 (patch)
treef5169705d1564e42b81ce4dfbbb5791066650d6d
parent5de412009407957e42ba3db90d1592a3b8438e87 (diff)
downloadaur-7771e33eca7be83b17e58caa5500987da71f75b6.tar.gz
patch for segfaults when formatting tables on some man pages
-rw-r--r--PKGBUILD12
-rw-r--r--fix-tbl-segfault.patch20
2 files changed, 30 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d4c2db83cf2..07c81d9d6d9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,11 +14,13 @@ conflicts=('man')
source=("https://mdocml.bsd.lv/snapshots/$pkgname-$pkgver.tar.gz"
'configure.local'
'mandoc.service'
- 'mandoc.timer')
+ 'mandoc.timer'
+ 'fix-tbl-segfault.patch')
sha256sums=('8219b42cb56fc07b2aa660574e6211ac38eefdbf21f41b698d3348793ba5d8f7'
'f0e8ddb61d063bec02a6a1f73f5d979bb548e7aabcf0a27c0d5c29c4194bfc8e'
'2091411d5f87a3c371a5ba74b4773d1e454046446fa2cb045485979e52419bb6'
- '74d6a02b97a17fffddcc0a3dc830e811348b1f6c6b84f867882c776d50f00ea4')
+ '74d6a02b97a17fffddcc0a3dc830e811348b1f6c6b84f867882c776d50f00ea4'
+ '12e6138be6ec2e8a34373876d8a5fce387a1d2b51a461ae20e1d98637af1d15c')
prepare() {
cd "$pkgname-$pkgver"
@@ -26,6 +28,12 @@ prepare() {
# fix configure script - see https://aur.archlinux.org/packages/mandoc/#comment-739085
sed -i -e 's/^CC=.*/CC=cc/' ./configure
+
+ # fix segfault when formatting tables on some man pages
+ patch -Np0 -i ../fix-tbl-segfault.patch
+
+ # remove useless duplicate global variables
+ sed -i -e '/^int dummy;$/d' ./compat_*.c
}
build() {
diff --git a/fix-tbl-segfault.patch b/fix-tbl-segfault.patch
new file mode 100644
index 00000000000..b3147c760e3
--- /dev/null
+++ b/fix-tbl-segfault.patch
@@ -0,0 +1,20 @@
+--- tbl_term.c 2020-08-18 12:35:27.290953791 +0200
++++ tbl_term.c 2020-08-18 12:35:23.450952148 +0200
+@@ -626,7 +626,7 @@
+
+ lw = cpp == NULL || cpn == NULL ||
+ (cpn->pos != TBL_CELL_DOWN &&
+- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
++ (dpn == NULL || dpn->pos == TBL_DATA_NONE || strcmp(dpn->string, "\\^") != 0))
+ ? hw : 0;
+ tbl_direct_border(tp, BHORIZ * lw,
+ col->width + col->spacing / 2);
+@@ -670,7 +670,7 @@
+
+ rw = cpp == NULL || cpn == NULL ||
+ (cpn->pos != TBL_CELL_DOWN &&
+- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
++ (dpn == NULL || dpn->pos == TBL_DATA_NONE || strcmp(dpn->string, "\\^") != 0))
+ ? hw : 0;
+
+ /* The line crossing at the end of this column. */