=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.150.2.8 retrieving revision 1.162 diff -u -p -r1.150.2.8 -r1.162 --- mandoc/read.c 2017/02/18 17:33:24 1.150.2.8 +++ mandoc/read.c 2017/03/06 17:26:05 1.162 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.150.2.8 2017/02/18 17:33:24 schwarze Exp $ */ +/* $Id: read.c,v 1.162 2017/03/06 17:26:05 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -19,10 +19,8 @@ #include "config.h" #include -#if HAVE_MMAP #include #include -#endif #include #include @@ -115,6 +113,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "bad NAME section content", "missing comma before name", "missing description line, using \"\"", + "description line outside NAME section", "sections out of conventional order", "duplicate section title", "unexpected section", @@ -604,14 +603,11 @@ static int read_whole_file(struct mparse *curp, const char *file, int fd, struct buf *fb, int *with_mmap) { -#if HAVE_MMAP struct stat st; -#endif gzFile gz; size_t off; ssize_t ssz; -#if HAVE_MMAP if (fstat(fd, &st) == -1) err((int)MANDOCLEVEL_SYSERR, "%s", file); @@ -633,7 +629,6 @@ read_whole_file(struct mparse *curp, const char *file, if (fb->buf != MAP_FAILED) return 1; } -#endif if (curp->gzip) { if ((gz = gzdopen(fd, "rb")) == NULL) @@ -758,11 +753,9 @@ mparse_readfd(struct mparse *curp, int fd, const char (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;