From 40030877d0c012555169f44c58f433040533888f Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sun, 11 Sep 2022 20:13:44 +0200 Subject: [PATCH] mdocml: fix .gz man pages in man.cgi --- srcpkgs/mdocml/patches/cgi-gz.patch | 22 ++++++++++++++++++++++ srcpkgs/mdocml/template | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/mdocml/patches/cgi-gz.patch diff --git a/srcpkgs/mdocml/patches/cgi-gz.patch b/srcpkgs/mdocml/patches/cgi-gz.patch new file mode 100644 index 00000000000..06af0c2d8d9 --- /dev/null +++ b/srcpkgs/mdocml/patches/cgi-gz.patch @@ -0,0 +1,22 @@ +--- a/cgi.c ++++ b/cgi.c +@@ -879,14 +879,15 @@ + int fd; + int usepath; + +- if (-1 == (fd = open(file, O_RDONLY, 0))) { ++ mchars_alloc(); ++ mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1 | ++ MPARSE_VALIDATE, MANDOC_OS_OTHER, req->q.manpath); ++ ++ if (-1 == (fd = mparse_open(mp, file))) { + puts("

You specified an invalid manual file.

"); + return; + } + +- mchars_alloc(); +- mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1 | +- MPARSE_VALIDATE, MANDOC_OS_OTHER, req->q.manpath); + mparse_readfd(mp, fd, file); + close(fd); + meta = mparse_result(mp); diff --git a/srcpkgs/mdocml/template b/srcpkgs/mdocml/template index af276779493..6c17fb814fa 100644 --- a/srcpkgs/mdocml/template +++ b/srcpkgs/mdocml/template @@ -1,7 +1,7 @@ # Template file for 'mdocml' pkgname=mdocml version=1.14.6 -revision=5 +revision=6 wrksrc="mandoc-${version}" build_style=configure make_build_args="all man.cgi"