diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-12-03 22:47:28 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-12-03 22:47:28 +0000 |
commit | 6fa544849dc025bd26420d59489d218746399709 (patch) | |
tree | 4a8fd3701e81b8ce97b1507d8388ebed15e48c83 /usr.bin | |
parent | dc99eee8dcc11a043a909cd7b613ac1309f7e31f (diff) |
remove useless "#ifdef __linux__" that crept in,
and trivial sync to bsd.lv (two new comments)
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/apropos_db.c | 9 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_macro.c | 13 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 12 |
3 files changed, 25 insertions, 9 deletions
diff --git a/usr.bin/mandoc/apropos_db.c b/usr.bin/mandoc/apropos_db.c index 519da73782b..b3c32e2c955 100644 --- a/usr.bin/mandoc/apropos_db.c +++ b/usr.bin/mandoc/apropos_db.c @@ -1,4 +1,4 @@ -/* $Id: apropos_db.c,v 1.12 2011/12/03 14:53:12 schwarze Exp $ */ +/* $Id: apropos_db.c,v 1.13 2011/12/03 22:47:27 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -24,12 +24,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> - -#ifdef __linux__ -# include <db_185.h> -#else -# include <db.h> -#endif +#include <db.h> #include "mandocdb.h" #include "apropos_db.h" diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index 7371b8c8b27..da05e3ac2f0 100644 --- a/usr.bin/mandoc/mdoc_macro.c +++ b/usr.bin/mandoc/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.70 2011/10/16 12:18:32 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.71 2011/12/03 22:47:27 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -596,6 +596,17 @@ dword(struct mdoc *m, int line, if (DELIM_OPEN == d) m->last->flags |= MDOC_DELIMO; + + /* + * Closing delimiters only suppress the preceding space + * when they follow something, not when they start a new + * block or element, and not when they follow `No'. + * + * XXX Explicitly special-casing MDOC_No here feels + * like a layering violation. Find a better way + * and solve this in the code related to `No'! + */ + else if (DELIM_CLOSE == d && m->last->prev && m->last->prev->tok != MDOC_No) m->last->flags |= MDOC_DELIMC; diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 236c15271fc..85bea2c39d5 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.99 2011/12/02 01:45:43 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.100 2011/12/03 22:47:27 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -1856,6 +1856,16 @@ post_sh_head(POST_ARGS) /* Mark our last section. */ mdoc->lastsec = sec; + + /* + * Set the section attribute for the current HEAD, for its + * parent BLOCK, and for the HEAD children; the latter can + * only be TEXT nodes, so no recursion is needed. + * For other blocks and elements, including .Sh BODY, this is + * done when allocating the node data structures, but for .Sh + * BLOCK and HEAD, the section is still unknown at that time. + */ + mdoc->last->parent->sec = sec; mdoc->last->sec = sec; for (n = mdoc->last->child; n; n = n->next) |