From 0addb10c581ec7696b03157cb7a93689b9930d8f Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 31 Jul 2017 10:21:26 +0200 Subject: [PATCH] mdocml: fix use of less(1), add boundary check against a segfault. --- srcpkgs/mdocml/patches/boundary-check.patch | 13 +++++++++++++ srcpkgs/mdocml/template | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/mdocml/patches/boundary-check.patch diff --git a/srcpkgs/mdocml/patches/boundary-check.patch b/srcpkgs/mdocml/patches/boundary-check.patch new file mode 100644 index 0000000000..f4f83e73b1 --- /dev/null +++ b/srcpkgs/mdocml/patches/boundary-check.patch @@ -0,0 +1,13 @@ +Else mount(8) segfaults due to n->tok = roff_SP. + +--- man_term.c 2017-07-30 12:00:19.858167629 -0400 ++++ man_term.c 2017-07-30 12:00:06.700039726 -0400 +@@ -674,7 +674,7 @@ + do { + n = n->prev; + } while (n != NULL && n->tok != TOKEN_NONE && +- termacts[n->tok].flags & MAN_NOTEXT); ++ n->tok >= MAN_TH && termacts[n->tok].flags & MAN_NOTEXT); + if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL)) + break; + diff --git a/srcpkgs/mdocml/template b/srcpkgs/mdocml/template index 4134379e9d..354a239219 100644 --- a/srcpkgs/mdocml/template +++ b/srcpkgs/mdocml/template @@ -1,7 +1,7 @@ # Template file for 'mdocml' pkgname=mdocml version=1.14.2 -revision=1 +revision=2 wrksrc="mandoc-1.14.2" build_style=configure makedepends="zlib-devel" @@ -25,7 +25,7 @@ alternatives=" post_extract() { # use less(1) - sed -i 's,bin/more,bin/less,g' main.c *.1 + sed -i 's,"more -s","less -s",g' main.c sed -i 's,.Xr more,.Xr less,g' *.1 } pre_configure() {