-/* $Id: read.c,v 1.85 2014/09/07 02:17:40 schwarze Exp $ */
+/* $Id: read.c,v 1.92 2014/10/20 19:04:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
"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 */
"obsolete macro",
"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",
"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",
"equation scope open on exit",
"overlapping equation scopes",
"unexpected end of equation",
- "equation syntax error",
/* related to tables */
"bad table syntax",
"skipping request without numeric argument",
"skipping all arguments",
"skipping excess arguments",
+ "divide by zero",
"generic fatal error",
(*curp->mmsg)(MANDOCERR_SYSOPEN,
curp->file_status,
file, 0, 0, strerror(errno));
- goto out;
+ return(curp->file_status);
}
/*
* 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);
}