summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_action.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-04-07 23:15:06 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-04-07 23:15:06 +0000
commit7137104835ca81318a9a2f20dbb47bfad38ea829 (patch)
tree851045dd0fa48e8867b4ee036b854bd6c4b80a15 /usr.bin/mandoc/mdoc_action.c
parent87cc166866f92a490fc02f4168d4ce0f3af45a70 (diff)
Merge the good parts of 1.9.23,
avoid the bad parts of 1.9.23, and keep local patches. Input in general: * Basic handling of roff-style font escapes \f, \F. * Quoted punctuation does not count as punctuation. mdoc(7) parser: * Make .Pf callable; noted by Claus Assmann. * Let .Bd and .Bl ignore unknown arguments; noted by deraadt@. * Do not warn when .Er is used outside certain sections. * Replace mdoc_node_free[list] by mdoc_node_delete. * Replace #define by enum for rew*() return values. man(7) parser: * When .TH is missing, use default section and date. Output in general: * Curly braces do not count as punctuation. * No space after .Fl w/o args when a macro follows on the same line. HTML output: * Unify PAIR_*_INIT macros, introduce new PAIR_ID_INIT(). * Print whitespace after, not before .Vt .Fn .Ft .Fo. Checked that all manuals in base still build.
Diffstat (limited to 'usr.bin/mandoc/mdoc_action.c')
-rw-r--r--usr.bin/mandoc/mdoc_action.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/usr.bin/mandoc/mdoc_action.c b/usr.bin/mandoc/mdoc_action.c
index cff9330ed98..9c00b2ac66d 100644
--- a/usr.bin/mandoc/mdoc_action.c
+++ b/usr.bin/mandoc/mdoc_action.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_action.c,v 1.29 2010/04/04 17:36:57 schwarze Exp $ */
+/* $Id: mdoc_action.c,v 1.30 2010/04/07 23:15:05 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -417,6 +417,10 @@ post_sh(POST_ARGS)
if ( ! concat(m, buf, n->child, BUFSIZ))
return(0);
sec = mdoc_atosec(buf);
+ /*
+ * The first section should always make us move into a non-new
+ * state.
+ */
if (SEC_NONE == m->lastnamed || SEC_CUSTOM != sec)
m->lastnamed = sec;
@@ -722,7 +726,7 @@ post_bl_head(POST_ARGS)
nn->string = NULL;
nnp = nn;
nn = nn->next;
- mdoc_node_free(nnp);
+ mdoc_node_delete(NULL, nnp);
}
n->nchild = 0;
@@ -847,29 +851,10 @@ post_dd(POST_ARGS)
static int
post_prol(POST_ARGS)
{
- struct mdoc_node *np;
-
- if (n->parent->child == n)
- n->parent->child = n->prev;
- if (n->prev)
- n->prev->next = NULL;
-
- np = n;
- assert(NULL == n->next);
-
- if (n->prev) {
- m->last = n->prev;
- m->next = MDOC_NEXT_SIBLING;
- } else {
- m->last = n->parent;
- m->next = MDOC_NEXT_CHILD;
- }
-
- mdoc_node_freelist(np);
+ mdoc_node_delete(m, n);
if (m->meta.title && m->meta.date && m->meta.os)
m->flags |= MDOC_PBODY;
-
return(1);
}