aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-11-10 21:34:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-11-10 21:34:04 +0000
commit5e0e65fbd25d66b3479bdd089f840bb078f27d13 (patch)
tree9c7dd2b97750759c8a884d983bc6776cccfefe8b /mandoc.c
parent9e5d8ac65f489ee18d32d762e187f80e25c7294f (diff)
downloadmandoc-5e0e65fbd25d66b3479bdd089f840bb078f27d13.tar.gz
mandoc-5e0e65fbd25d66b3479bdd089f840bb078f27d13.tar.zst
mandoc-5e0e65fbd25d66b3479bdd089f840bb078f27d13.zip
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 'mandoc.c')
-rw-r--r--mandoc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mandoc.c b/mandoc.c
index 963b5b49..2936ef93 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.69 2013/10/05 20:30:05 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.70 2013/11/10 21:34:04 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -93,8 +93,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;