=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.126 retrieving revision 1.131 diff -u -p -r1.126 -r1.131 --- mandoc/read.c 2015/02/06 16:06:25 1.126 +++ mandoc/read.c 2015/03/11 13:05:20 1.131 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.126 2015/02/06 16:06:25 schwarze Exp $ */ +/* $Id: read.c,v 1.131 2015/03/11 13:05:20 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -109,7 +109,10 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "no document body", "content before first section header", "first section is not \"NAME\"", - "bad NAME section contents", + "NAME section without name", + "NAME section without description", + "description not at the end of NAME", + "bad NAME section content", "missing description line, using \"\"", "sections out of conventional order", "duplicate section title", @@ -399,7 +402,8 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size MANDOCERR_CHAR_UNSUPP, curp, curp->line, pos, "0x%x", c); i++; - ln.buf[pos++] = '?'; + if (c != '\r') + ln.buf[pos++] = '?'; continue; } @@ -632,7 +636,7 @@ read_whole_file(struct mparse *curp, const char *file, */ if (S_ISREG(st.st_mode)) { - if (st.st_size >= (1U << 31)) { + if (st.st_size > 0x7fffffff) { mandoc_msg(MANDOCERR_TOOLARGE, curp, 0, 0, NULL); return(0); } @@ -864,6 +868,7 @@ mparse_wait(struct mparse *curp) perror("wait"); exit((int)MANDOCLEVEL_SYSERR); } + curp->child = 0; if (WIFSIGNALED(status)) { mandoc_vmsg(MANDOCERR_FILE, curp, 0, 0, "gunzip died from signal %d", WTERMSIG(status));