mdocml: fix .gz man pages in man.cgi

This commit is contained in:
Duncaen 2022-09-11 20:13:44 +02:00
parent 73b4967a02
commit 40030877d0
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35
2 changed files with 23 additions and 1 deletions

View File

@ -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("<p>You specified an invalid manual file.</p>");
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);

View File

@ -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"