summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-10-18 22:44:29 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-10-18 22:44:29 +0000
commit2174fec27769e059c821306e9c2203b64c140cfb (patch)
tree696defd0240921348930b8385891183d1e4dbbfa
parent7e618b64a18a8bbecc05bc9fed19c5a46cb91c8e (diff)
downloadmandoc-2174fec27769e059c821306e9c2203b64c140cfb.tar.gz
merge ".Bl -tag without -width" fix to 1.13 branch
-rw-r--r--read.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/read.c b/read.c
index ea7670c0..5a7efd60 100644
--- a/read.c
+++ b/read.c
@@ -19,8 +19,10 @@
#include "config.h"
#include <sys/types.h>
+#if HAVE_MMAP
#include <sys/mman.h>
#include <sys/stat.h>
+#endif
#include <assert.h>
#include <ctype.h>
@@ -141,7 +143,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"empty argument, using 0n",
"missing display type, using -ragged",
"list type is not the first argument",
- "missing -width in -tag list, using 8n",
+ "missing -width in -tag list, using 6n",
"missing utility name, using \"\"",
"missing function name, using \"\"",
"empty head in list item",
@@ -596,6 +598,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd,
size_t off;
ssize_t ssz;
+#if HAVE_MMAP
struct stat st;
if (fstat(fd, &st) == -1)
@@ -619,6 +622,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd,
if (fb->buf != MAP_FAILED)
return 1;
}
+#endif
if (curp->gzip) {
if ((gz = gzdopen(fd, "rb")) == NULL)
@@ -743,9 +747,11 @@ mparse_readfd(struct mparse *curp, int fd, const char *file)
(MPARSE_UTF8 | MPARSE_LATIN1);
mparse_parse_buffer(curp, blk, file);
curp->filenc = save_filenc;
+#if HAVE_MMAP
if (with_mmap)
munmap(blk.buf, blk.sz);
else
+#endif
free(blk.buf);
}
return curp->file_status;