aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-01-01 13:17:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-01-01 13:17:58 +0000
commit8dfb6885b4ca139f27de89b37393a0570defeee6 (patch)
treed8db8a4f48ff913d7a54992a0b8432e99c034252 /mdoc_macro.c
parent41eb251d81c9a1ef2f4036c8b217c0f024b490c2 (diff)
downloadmandoc-8dfb6885b4ca139f27de89b37393a0570defeee6.tar.gz
mandoc-8dfb6885b4ca139f27de89b37393a0570defeee6.tar.zst
mandoc-8dfb6885b4ca139f27de89b37393a0570defeee6.zip
`Fl' has each argument be in a separate scope (thanks Ingo Schwarze).
Situation of `Fl [arg]* "" [arg]*' is fixed: empty arguments are ignored. Note that OpenBSD crashes when this happens. Situation of `Fl' is fixed wrt trailing whitespace.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 4ca9b5bc..fa4432e9 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.38 2009/10/26 17:05:44 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.39 2010/01/01 13:17:58 kristaps 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))