aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-17 11:30:23 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-17 11:30:23 +0000
commit23a24bf33187bc5c870f18253d69add673316375 (patch)
treee43c31430c8861ef536b97de7672b0c7fb6a254b /mdoc_macro.c
parent8ccf0c87185bc55b87c3903be984e8afa6e46f7c (diff)
downloadmandoc-23a24bf33187bc5c870f18253d69add673316375.tar.gz
mandoc-23a24bf33187bc5c870f18253d69add673316375.tar.zst
mandoc-23a24bf33187bc5c870f18253d69add673316375.zip
Clean-up in libmdoc: fix last checks for mdoc_*msg return value, then
make mdoc_vmsg not return an int. libmdoc is now completely clean of return-value checks from the message subsystem.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 740c1596..e6bf8b2d 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.102 2011/03/17 09:16:38 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.103 2011/03/17 11:30:23 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -710,8 +710,7 @@ blk_exp_close(MACRO_PROT_ARGS)
if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) {
/* FIXME: do this in validate */
if (buf[*pos])
- if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_ARGSLOST))
- return(0);
+ mdoc_pmsg(m, line, ppos, MANDOCERR_ARGSLOST);
if ( ! rew_sub(MDOC_BODY, m, tok, line, ppos))
return(0);
@@ -854,9 +853,9 @@ in_line(MACRO_PROT_ARGS)
return(0);
} else if ( ! nc && 0 == cnt) {
mdoc_argv_free(arg);
- if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY))
- return(0);
+ mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY);
}
+
if ( ! mdoc_macro(m, ntok, line, la, pos, buf))
return(0);
if ( ! nl)
@@ -936,8 +935,7 @@ in_line(MACRO_PROT_ARGS)
return(0);
} else if ( ! nc && 0 == cnt) {
mdoc_argv_free(arg);
- if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY))
- return(0);
+ mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY);
}
if ( ! nl)
@@ -1299,9 +1297,9 @@ blk_part_imp(MACRO_PROT_ARGS)
* is ugly behaviour nodding its head to OpenBSD's overwhelming
* crufty use of `Op' breakage.
*/
- if (n != body && ! mdoc_vmsg(m, MANDOCERR_SCOPENEST,
- line, ppos, "%s broken", mdoc_macronames[tok]))
- return(0);
+ if (n != body)
+ mdoc_vmsg(m, MANDOCERR_SCOPENEST, line, ppos,
+ "%s broken", mdoc_macronames[tok]);
if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos))
return(0);
@@ -1673,7 +1671,8 @@ static int
obsolete(MACRO_PROT_ARGS)
{
- return(mdoc_pmsg(m, line, ppos, MANDOCERR_MACROOBS));
+ mdoc_pmsg(m, line, ppos, MANDOCERR_MACROOBS);
+ return(1);
}