summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-11-12 22:31:22 +0000
committerschwarze <schwarze@openbsd.org>2011-11-12 22:31:22 +0000
commitd095f66d39d68f52bb4faf5b512895710b1e47c3 (patch)
treeda58a61025a471ab1f02d5acb02a59be69d7b6f2
parentfix function names in fatalx() messages (diff)
downloadwireguard-openbsd-d095f66d39d68f52bb4faf5b512895710b1e47c3.tar.xz
wireguard-openbsd-d095f66d39d68f52bb4faf5b512895710b1e47c3.zip
Parse and ignore the C font family in \f escapes.
Helps with some real-world manuals that (incorrectly) assume that the C font family means "constant width". Suggested by Andreas Vogele, patch by kristaps@.
-rw-r--r--usr.bin/mandoc/mandoc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c
index 716940f257c..7e1c66ed9ec 100644
--- a/usr.bin/mandoc/mandoc.c
+++ b/usr.bin/mandoc/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.29 2011/10/24 20:29:21 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.30 2011/11/12 22:31:22 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -365,8 +365,15 @@ out:
switch (gly) {
case (ESCAPE_FONT):
- if (1 != rlim)
+ /*
+ * Pretend that the constant-width font modes are the
+ * same as the regular font modes.
+ */
+ if (2 == rlim && 'C' == *rstart)
+ rstart++;
+ else if (1 != rlim)
break;
+
switch (*rstart) {
case ('3'):
/* FALLTHROUGH */