From afb180e15d367defc95aaa463d91e65080fe0066 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 6 May 2006 22:04:29 +0000 Subject: [PATCH] Support for non-breaking spaces in the "man" backend. This has the odd side-effect 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 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bk_man.c b/bk_man.c index 2eff926..8daf2a8 100644 --- 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, -- 2.11.0