aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-20 23:55:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-20 23:55:10 +0000
commit211d0cf018915b183c0683f88aacce7eed951b1f (patch)
tree7991ffd3c2b13c786e5e880958d3043769424d46
parentd5ba4ec690d23e78c49f85a785f68f1867a04ddc (diff)
downloadmandoc-211d0cf018915b183c0683f88aacce7eed951b1f.tar.gz
mandoc-211d0cf018915b183c0683f88aacce7eed951b1f.tar.zst
mandoc-211d0cf018915b183c0683f88aacce7eed951b1f.zip
For selecting a two-digit font size, support the historic syntax \s12
in addition to the classic syntax \s(12, the modern syntax \s[12], and the alternative syntax \s'12'. The historic syntax only works for the font sizes 10-39. Real-world usage found by naddy@ in plan9/rc.
-rw-r--r--mandoc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mandoc.c b/mandoc.c
index a61d2331..0619420c 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.91 2015/01/21 20:33:25 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.92 2015/02/20 23:55:10 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -242,6 +242,14 @@ mandoc_escape(const char **end, const char **start, int *sz)
*start = ++*end;
term = '\'';
break;
+ case '3':
+ /* FALLTHROUGH */
+ case '2':
+ /* FALLTHROUGH */
+ case '1':
+ *sz = (*end)[-1] == 's' &&
+ isdigit((unsigned char)(*end)[1]) ? 2 : 1;
+ break;
default:
*sz = 1;
break;