From 6d097dd9463df26b76807e6d7a0d50e9d7e6cd10 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/read.c b/read.c index 21d28b0b..60ef105f 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.151 2016/07/19 21:31:55 schwarze Exp $ */ +/* $Id: read.c,v 1.150.2.1 2016/10/18 22:44:29 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2016 Ingo Schwarze @@ -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 v1.2.3-56-ge451