diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-11-10 20:17:15 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-11-10 20:17:15 +0000 |
commit | 52f345c097d1cdd19c91788167e29d1c822198c8 (patch) | |
tree | aae2af10426959729a7b0b5ee2370dcf54b59f63 /usr.bin | |
parent | 545f8030b243615d3adb03dee4345d952f58ed70 (diff) |
Support the alternative syntax \C'uXXXX' for Unicode characters.
It is already documented in the Heirloom troff manual,
and groff handles it as well.
Bug reported by Bjarni Ingi Gislason <bjarniig at rhi dot hi dot is>
on <bug-groff at gnu dot org>. Well, admittedly, that bug was reported
against groff, but mandoc was even more broken than groff with respect
to this syntax...
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/mandoc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c index f24da3895e8..b96077b4e70 100644 --- a/usr.bin/mandoc/mandoc.c +++ b/usr.bin/mandoc/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.38 2013/10/05 21:17:29 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.39 2013/11/10 20:17:14 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org> @@ -89,8 +89,11 @@ mandoc_escape(const char const **end, const char const **start, int *sz) case ('C'): if ('\'' != **start) return(ESCAPE_ERROR); - gly = ESCAPE_SPECIAL; *start = ++*end; + if ('u' == (*start)[0] && '\'' != (*start)[1]) + gly = ESCAPE_UNICODE; + else + gly = ESCAPE_SPECIAL; term = '\''; break; |