=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.86 retrieving revision 1.92 diff -u -p -r1.86 -r1.92 --- mandoc/read.c 2014/09/07 23:25:01 1.86 +++ mandoc/read.c 2014/10/20 19:04:45 1.92 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.86 2014/09/07 23:25:01 schwarze Exp $ */ +/* $Id: read.c,v 1.92 2014/10/20 19:04:45 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -117,6 +117,8 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "sections out of conventional order", "duplicate section title", "unexpected section", + "unusual Xr order", + "unusual Xr punctuation", "AUTHORS section without An macro", /* related to macros and nesting */ @@ -147,6 +149,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "missing font type, using \\fR", "unknown font type, using \\fR", "missing -std argument, adding it", + "missing eqn box, using \"\"", /* related to bad macro arguments */ "unterminated quoted argument", @@ -156,6 +159,8 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "skipping duplicate list type", "skipping -width argument", "unknown AT&T UNIX version", + "comma in function argument", + "parenthesis in function name", "invalid content in Rs block", "invalid Boolean argument", "unknown font, skipping request", @@ -175,7 +180,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "equation scope open on exit", "overlapping equation scopes", "unexpected end of equation", - "equation syntax error", /* related to tables */ "bad table syntax", @@ -207,6 +211,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "skipping request without numeric argument", "skipping all arguments", "skipping excess arguments", + "divide by zero", "generic fatal error", @@ -764,7 +769,7 @@ mparse_readfd(struct mparse *curp, int fd, const char (*curp->mmsg)(MANDOCERR_SYSOPEN, curp->file_status, file, 0, 0, strerror(errno)); - goto out; + return(curp->file_status); } /* @@ -774,21 +779,19 @@ mparse_readfd(struct mparse *curp, int fd, const char * the parse phase for the file. */ - if ( ! read_whole_file(curp, file, fd, &blk, &with_mmap)) - goto out; - - mparse_parse_buffer(curp, blk, file); - + if (read_whole_file(curp, file, fd, &blk, &with_mmap)) { + mparse_parse_buffer(curp, blk, file); #if HAVE_MMAP - if (with_mmap) - munmap(blk.buf, blk.sz); - else + if (with_mmap) + munmap(blk.buf, blk.sz); + else #endif - free(blk.buf); + free(blk.buf); + } if (STDIN_FILENO != fd && -1 == close(fd)) perror(file); -out: + return(curp->file_status); }