summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2006-05-07 11:35:51 +0000
committerBen Harris <bjh21@bjh21.me.uk>2006-05-07 11:35:51 +0000
commit86dd3f72469e3f35c5f9ef95919e670d621c1a32 (patch)
treefe5e5d39280ce2b2d7f5308c8c58411cea84fa8f
parentf260ea6f412ef4b7e9a39b62a1764f366fefddd2 (diff)
downloadhalibut-86dd3f72469e3f35c5f9ef95919e670d621c1a32.zip
halibut-86dd3f72469e3f35c5f9ef95919e670d621c1a32.tar.gz
halibut-86dd3f72469e3f35c5f9ef95919e670d621c1a32.tar.bz2
halibut-86dd3f72469e3f35c5f9ef95919e670d621c1a32.tar.xz
When we want a printed backslash, use \e rather than \\, since the former
works correctly inside macro arguments. [originally from svn r6658]
-rw-r--r--bk_man.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/bk_man.c b/bk_man.c
index 7bd19ea..32f731c 100644
--- 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)) {