diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2006-05-06 22:04:29 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2006-05-06 22:04:29 +0000 |
| commit | 55dfacbd204d0ae050589931609a56a815c62696 (patch) | |
| tree | 864f7f83b8cac8be2de29eb406ec67bbf9e86170 | |
| parent | 9316d5c4f849f22176031b1d8fbde17681d378d4 (diff) | |
| download | halibut-55dfacbd204d0ae050589931609a56a815c62696.zip halibut-55dfacbd204d0ae050589931609a56a815c62696.tar.gz halibut-55dfacbd204d0ae050589931609a56a815c62696.tar.bz2 halibut-55dfacbd204d0ae050589931609a56a815c62696.tar.xz | |
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.
[originally from svn r6652]
| -rw-r--r-- | bk_man.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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, |