`man', at least on Debian 3.1, will treat a paragraph beginning with
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 11 Oct 2006 11:13:30 +0000 (11:13 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 11 Oct 2006 11:13:30 +0000 (11:13 +0000)
a period specially _even_ if there's an \fB or similar escape
sequence before the period. Therefore, man_rdaddctrl() now doesn't
clear the QUOTE_INITCTRL flag just because it generated some text;
instead, its call sites clear the flag when the _type_ of generated
text is appropriate for this. This should remove an error from the
`lns' man page (utils/lns/lns.but), which was where I noticed the
problem.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6871 cda61777-01e9-0310-a592-d414129be87e

bk_man.c

index 2f44818..1146150 100644 (file)
--- a/bk_man.c
+++ b/bk_man.c
@@ -541,8 +541,6 @@ static int man_rdaddctrl(rdstringc *rs, char *c, int quote_props,
                         manconfig *conf, charset_state *state) {
     quote_props = man_rdaddwc_reset(rs, quote_props, conf, state);
     rdaddsc(rs, c);
-    if (*c)
-       quote_props &= ~QUOTE_INITCTRL;   /* not at start any more */
     return quote_props;
 }
 
@@ -604,9 +602,11 @@ static int man_rdaddwc(rdstringc *rs, word *text, word *end,
                        quote_props &= ~QUOTE_INITCTRL;   /* not at start any more */
                    *state = s2;
                }
-               if (hyphen)
+               if (hyphen) {
                    quote_props =
                        man_rdaddctrl(rs, "-", quote_props, conf, state);
+                   quote_props &= ~QUOTE_INITCTRL;
+               }
            } else {
                quote_props = man_rdaddwc(rs, text->alt, NULL,
                                          quote_props, conf, state);
@@ -615,6 +615,7 @@ static int man_rdaddwc(rdstringc *rs, word *text, word *end,
                sfree(c);
        } else if (removeattr(text->type) == word_WhiteSpace) {
            quote_props = man_rdaddctrl(rs, " ", quote_props, conf, state);
+           quote_props &= ~QUOTE_INITCTRL;
        } else if (removeattr(text->type) == word_Quote) {
            man_convert(quoteaux(text->aux) == quote_Open ?
                        conf->lquote : conf->rquote, 0,