=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.35 retrieving revision 1.40 diff -u -p -r1.35 -r1.40 --- mandoc/mdoc_macro.c 2009/09/16 20:49:06 1.35 +++ mandoc/mdoc_macro.c 2010/01/01 17:14:29 1.40 @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.35 2009/09/16 20:49:06 kristaps Exp $ */ +/* $Id: mdoc_macro.c,v 1.40 2010/01/01 17:14:29 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -14,11 +14,16 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include #include #include +#include #include "libmdoc.h" @@ -174,6 +179,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { { in_line_eoln, 0 }, /* %Q */ { in_line_eoln, 0 }, /* br */ { in_line_eoln, 0 }, /* sp */ + { in_line_eoln, 0 }, /* %U */ }; const struct mdoc_macro * const mdoc_macros = __mdoc_macros; @@ -260,6 +266,7 @@ mdoc_macroend(struct mdoc *m) static int lookup(int from, const char *p) { + /* FIXME: make -diag lists be un-PARSED. */ if ( ! (MDOC_PARSED & mdoc_macros[from].flags)) return(MDOC_MAX); @@ -805,6 +812,17 @@ in_line(MACRO_PROT_ARGS) cnt++; if ( ! mdoc_word_alloc(m, line, la, p)) return(0); + + /* + * `Fl' macros have their scope re-opened with each new + * word so that the `-' can be added to each one without + * having to parse out spaces. + */ + if (0 == lastpunct && MDOC_Fl == tok) { + if ( ! rew_elem(m, tok)) + return(0); + lastpunct = 1; + } } if (0 == lastpunct && ! rew_elem(m, tok))