=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.150.2.2 retrieving revision 1.150.2.6 diff -u -p -r1.150.2.2 -r1.150.2.6 --- mandoc/read.c 2016/11/10 12:52:12 1.150.2.2 +++ mandoc/read.c 2017/01/28 23:35:05 1.150.2.6 @@ -1,7 +1,7 @@ -/* $Id: read.c,v 1.150.2.2 2016/11/10 12:52:12 schwarze Exp $ */ +/* $Id: read.c,v 1.150.2.6 2017/01/28 23:35:05 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010-2016 Ingo Schwarze + * Copyright (c) 2010-2017 Ingo Schwarze * Copyright (c) 2010, 2012 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any @@ -110,10 +110,11 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "no document body", "content before first section header", "first section is not \"NAME\"", - "NAME section without name", + "NAME section without Nm before Nd", "NAME section without description", "description not at the end of NAME", "bad NAME section content", + "missing comma before name", "missing description line, using \"\"", "sections out of conventional order", "duplicate section title", @@ -152,6 +153,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "unknown font type, using \\fR", "nothing follows prefix", "empty reference block", + "missing section argument", "missing -std argument, adding it", "missing option string, using \"\"", "missing resource identifier, using \"\"", @@ -177,6 +179,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "blank line in fill mode, using .sp", "tab in filled text", "whitespace at end of input line", + "new sentence, new line", "bad comment style", "invalid escape sequence", "undefined string, using \"\"", @@ -317,6 +320,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size const char *save_file; char *cp; size_t pos; /* byte number in the ln buffer */ + size_t j; /* auxiliary byte number in the blk buffer */ enum rofferr rr; int of; int lnn; /* line number in the real file */ @@ -422,6 +426,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size } if ('"' == blk.buf[i + 1] || '#' == blk.buf[i + 1]) { + j = i; i += 2; /* Comment, skip to end of line */ for (; i < blk.sz; ++i) { @@ -432,7 +437,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size mandoc_msg( MANDOCERR_SPACE_EOL, curp, curp->line, - pos, NULL); + pos + i-1 - j, NULL); ++i; ++lnn; break; @@ -866,6 +871,13 @@ mparse_result(struct mparse *curp, struct roff_man **m } if (man) *man = curp->man; +} + +void +mparse_updaterc(struct mparse *curp, enum mandoclevel *rc) +{ + if (curp->file_status > *rc) + *rc = curp->file_status; } void