summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-06-20 17:24:00 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-06-20 17:24:00 +0000
commitf55f857f8f078275f8f6d914367c3075c9e25022 (patch)
tree32eae989a5989bbd16b4929027c3c2df76fd428c /mdoc.c
parent6b6c88dfdce932cd2de0f3b003a8bf31558b0fbe (diff)
downloadmandoc-f55f857f8f078275f8f6d914367c3075c9e25022.tar.gz
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 'mdoc.c')
-rw-r--r--mdoc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mdoc.c b/mdoc.c
index 69b74042..6137be57 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -305,7 +305,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);
}
@@ -313,7 +314,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)