aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit6d097dd9463df26b76807e6d7a0d50e9d7e6cd10 (patch)
tree4539f075826dc5c0b7935786ab8180aee6b043cb
parent85e209c412cbd32d66ab73439532fbff7213d8c3 (diff)
downloadmandoc-6d097dd9463df26b76807e6d7a0d50e9d7e6cd10.tar.gz
mandoc-6d097dd9463df26b76807e6d7a0d50e9d7e6cd10.tar.zst
mandoc-6d097dd9463df26b76807e6d7a0d50e9d7e6cd10.zip
merge ".Bl -tag without -width" fix to 1.13 branch
-rw-r--r--read.c10
1 files 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 <kristaps@bsd.lv>
* Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;