summaryrefslogtreecommitdiffstats
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
commit686b4d965f981326a795a8476888351e5cfe3ae9 (patch)
tree87840f049ebde49f20e8998f8f92ffb42b9de77e /mandoc.c
parentee4cd35f18e29bf02ffa319ff6f51e469f45a4da (diff)
downloadmandoc-686b4d965f981326a795a8476888351e5cfe3ae9.tar.gz
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mandoc.c b/mandoc.c
index fab0c440..4cba828d 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -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;