diff options
author | 2014-06-20 17:23:09 +0000 | |
---|---|---|
committer | 2014-06-20 17:23:09 +0000 | |
commit | 1d5a8eebc0b93633950b204ae1da7c6b6528506c (patch) | |
tree | 0b3c91c149ae1058e32b338eeb2396bacdd1c958 /usr.bin/mandoc/mdoc.c | |
parent | Prefix error messages from mandoc(1) with "mandoc: " (diff) | |
download | wireguard-openbsd-1d5a8eebc0b93633950b204ae1da7c6b6528506c.tar.xz wireguard-openbsd-1d5a8eebc0b93633950b204ae1da7c6b6528506c.zip |
Start systematic improvements of error reporting.
So far, this covers all WARNINGs related to the prologue.
1) hierarchical naming of MANDOCERR_* constants
2) mention the macro name in messages where that adds clarity
3) add one missing MANDOCERR_DATE_MISSING msg
4) fix the wording of one message related to the man(7) prologue
Started on the plane back from Ottawa.
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index f0d86ad3398..c59fb662f2f 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.104 2014/04/25 14:10:59 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.105 2014/06/20 17:23:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -301,7 +301,8 @@ mdoc_macro(MACRO_PROT_ARGS) if (MDOC_PROLOGUE & mdoc_macros[tok].flags && MDOC_PBODY & mdoc->flags) { - mdoc_pmsg(mdoc, line, ppos, MANDOCERR_BADBODY); + mandoc_vmsg(MANDOCERR_PROLOG_ONLY, mdoc->parse, + line, ppos, "%s", mdoc_macronames[tok]); return(1); } @@ -309,7 +310,8 @@ mdoc_macro(MACRO_PROT_ARGS) if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) && ! (MDOC_PBODY & mdoc->flags)) { - mdoc_pmsg(mdoc, line, ppos, MANDOCERR_BADPROLOG); + mandoc_vmsg(MANDOCERR_PROLOG_BAD, mdoc->parse, + line, ppos, "%s", mdoc_macronames[tok]); if (NULL == mdoc->meta.msec) mdoc->meta.msec = mandoc_strdup("1"); if (NULL == mdoc->meta.title) |