When we want a printed backslash, use \e rather than \\, since the former
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 7 May 2006 11:35:51 +0000 (11:35 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 7 May 2006 11:35:51 +0000 (11:35 +0000)
works correctly inside macro arguments.

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

bk_man.c

index 7bd19ea..32f731c 100644 (file)
--- a/bk_man.c
+++ b/bk_man.c
@@ -475,16 +475,15 @@ static int man_convert(wchar_t const *s, int maxlen,
                 */
                rdaddc(&out, '\\');
                rdaddc(&out, '&');
-           } else if (*q == '\\' || *q == '`' || *q == ' ') {
-               /*
-                * Quote backslashes, backticks and nonbreakable
-                * spaces always.
-                */
+           } else if (*q == '`' || *q == ' ') {
+               /* Quote backticks and nonbreakable spaces always. */
                rdaddc(&out, '\\');
+           } else if (*q == '\\') {
+               /* Turn backslashes into \e. */
+               rdaddsc(&out, "\\e");
+               continue;
            } else if (*q == '-') {
-               /*
-                * Turn nonbreakable hyphens into \(hy.
-                */
+               /* Turn nonbreakable hyphens into \(hy. */
                rdaddsc(&out, "\\(hy");
                continue;
            } else if (*q == '"' && (quote_props & QUOTE_QUOTES)) {