summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-19 07:20:20 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-19 07:20:20 +0000
commite6973bd6646ce01967620c0ae2759a96cb5c509d (patch)
tree1ec39fd3b93cc7f1704890b63b7352fcaf09b7c6 /usr.bin/mandoc/mdoc.c
parentf6bcb5489ed1cef30b0952eab011571043ee7444 (diff)
sync to 1.7.19: more elegant section handling
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r--usr.bin/mandoc/mdoc.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 8d8adf023aa..cb2034d7c50 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.8 2009/06/18 23:51:12 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.9 2009/06/19 07:20:19 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -144,7 +144,7 @@ mdoc_alloc1(struct mdoc *mdoc)
bzero(&mdoc->meta, sizeof(struct mdoc_meta));
mdoc->flags = 0;
- mdoc->lastnamed = mdoc->lastsec = 0;
+ mdoc->lastnamed = mdoc->lastsec = SEC_NONE;
mdoc->last = calloc(1, sizeof(struct mdoc_node));
if (NULL == mdoc->last)
return(0);
@@ -371,14 +371,11 @@ mdoc_macro(struct mdoc *m, int tok,
int ln, int pp, int *pos, char *buf)
{
- /* FIXME - these should happen during validation. */
-
if (MDOC_PROLOGUE & mdoc_macros[tok].flags &&
- SEC_PROLOGUE != m->lastnamed)
+ MDOC_PBODY & m->flags)
return(perr(m, ln, pp, EPROLBODY));
-
if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) &&
- SEC_PROLOGUE == m->lastnamed)
+ ! (MDOC_PBODY & m->flags))
return(perr(m, ln, pp, EBODYPROL));
if (1 != pp && ! (MDOC_CALLABLE & mdoc_macros[tok].flags))
@@ -629,7 +626,7 @@ static int
parsetext(struct mdoc *m, int line, char *buf)
{
- if (SEC_PROLOGUE == m->lastnamed)
+ if (SEC_NONE == m->lastnamed)
return(perr(m, line, 0, ETEXTPROL));
if (0 == buf[0] && ! (MDOC_LITERAL & m->flags))