summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-01-01 19:24:08 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-01-01 19:24:08 +0000
commit3d173178f17eecc18835546dae40f017f04a69eb (patch)
treed5120c3a84f8e1712ad46d14b01a033b30fcf095
parent09d8f878b8f839d5b733b19ba03fe33b6493d264 (diff)
When multiple arguments are passed to .Fl,
each should be rendered with its own dash. Fixes regress/usr.bin/mandoc/mdoc/Fl/multiarg.in; ok kristaps@ and merged upstream in rev. 1.39.
-rw-r--r--usr.bin/mandoc/mdoc_macro.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index 224ac65e8e2..05b9d9d9ba3 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.26 2009/12/22 23:58:00 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.27 2010/01/01 19:24:07 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -808,6 +808,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))