X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/46b6fb73529e79de5452e9d25e26a7c8b83bd79f..b93b7d11befe80f204689861fdaa729f36298ebb:/mandoc.c diff --git a/mandoc.c b/mandoc.c index 671f059a..465965a4 100644 --- a/mandoc.c +++ b/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.51 2011/05/14 17:54:42 kristaps Exp $ */ +/* $Id: mandoc.c,v 1.53 2011/05/24 21:31:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -125,6 +125,14 @@ mandoc_escape(const char **end, const char **start, int *sz) break; case ('['): gly = ESCAPE_SPECIAL; + /* + * Unicode escapes are defined in groff as \[uXXXX] to + * \[u10FFFF], where the contained value must be a valid + * Unicode codepoint. Here, however, only check whether + * it's not a zero-width escape. + */ + if ('u' == cp[i] && ']' != cp[i + 1]) + gly = ESCAPE_UNICODE; term = ']'; break; case ('C'): @@ -156,10 +164,6 @@ mandoc_escape(const char **end, const char **start, int *sz) if (ESCAPE_ERROR == gly) gly = ESCAPE_IGNORE; /* FALLTHROUGH */ - case ('*'): - if (ESCAPE_ERROR == gly) - gly = ESCAPE_PREDEF; - /* FALLTHROUGH */ case ('f'): if (ESCAPE_ERROR == gly) gly = ESCAPE_FONT;