summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-17 22:11:42 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-17 22:11:42 +0000
commitb11413460f4cfc6adeaaec03d30246715922f54d (patch)
tree4836abc5d313954c48af7a9145a26a861f309230 /mdoc_term.c
parent4123a170dcf7bb0ee57516df099aa6efc10ef5e1 (diff)
downloadmandoc-b11413460f4cfc6adeaaec03d30246715922f54d.tar.gz
Enable the unified error/warning enumeration in mandoc.h that's
stringified in main.c. Allow `An' to handle an argument and child (with a warning). Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a warning). Allow inconsistent column syntax to only raise a warning.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index fe43bd58..31d435b1 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
+#include "mandoc.h"
#include "out.h"
#include "term.h"
#include "mdoc.h"
@@ -1085,6 +1086,8 @@ static int
termp_nm_pre(DECL_ARGS)
{
+ if (NULL == n->child && NULL == m->name)
+
if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)
term_newln(p);
@@ -1092,6 +1095,7 @@ termp_nm_pre(DECL_ARGS)
if (NULL == n->child)
term_word(p, m->name);
+
return(1);
}
@@ -1216,7 +1220,7 @@ termp_rv_pre(DECL_ARGS)
term_word(p, "()");
}
- if (n->child->next)
+ if (n->child && n->child->next)
term_word(p, "functions return");
else
term_word(p, "function returns");
@@ -1255,7 +1259,7 @@ termp_ex_pre(DECL_ARGS)
p->flags &= ~TERMP_NOSPACE;
}
- if (n->child->next)
+ if (n->child && n->child->next)
term_word(p, "utilities exit");
else
term_word(p, "utility exits");