From 2174fec27769e059c821306e9c2203b64c140cfb Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 18 Oct 2016 22:44:29 +0000 Subject: merge ".Bl -tag without -width" fix to 1.13 branch --- read.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'read.c') 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 +#if HAVE_MMAP #include #include +#endif #include #include @@ -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; -- cgit