Support for non-breaking spaces in the "man" backend. This has the odd side-effect
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sat, 6 May 2006 22:04:29 +0000 (22:04 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sat, 6 May 2006 22:04:29 +0000 (22:04 +0000)
that breaking spaces are now forces to be ASCII spaces in output, whatever output
charset is in force.  I doubt this will inconvenience anyone.

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

bk_man.c

index 2eff926..8daf2a8 100644 (file)
--- a/bk_man.c
+++ b/bk_man.c
@@ -475,9 +475,10 @@ static int man_convert(wchar_t const *s, int maxlen,
                 */
                rdaddc(&out, '\\');
                rdaddc(&out, '&');
-           } else if (*q == '\\' || *q == '`') {
+           } else if (*q == '\\' || *q == '`' || *q == ' ') {
                /*
-                * Quote backslashes and backticks always.
+                * Quote backslashes, backticks and nonbreakable
+                * spaces always.
                 */
                rdaddc(&out, '\\');
            } else if (*q == '"' && (quote_props & QUOTE_QUOTES)) {
@@ -585,11 +586,8 @@ static int man_rdaddwc(rdstringc *rs, word *text, word *end,
            }
            sfree(c);
        } else if (removeattr(text->type) == word_WhiteSpace) {
-           man_convert(L" ", 1, &c, quote_props, conf->charset, state);
-           rdaddsc(rs, c);
-           if (*c)
-               quote_props &= ~QUOTE_INITCTRL;   /* not at start any more */
-           sfree(c);
+           rdaddc(rs, ' ');
+           quote_props &= ~QUOTE_INITCTRL;   /* not at start any more */
        } else if (removeattr(text->type) == word_Quote) {
            man_convert(quoteaux(text->aux) == quote_Open ?
                        conf->lquote : conf->rquote, 0,