=================================================================== RCS file: /cvs/mandoc/mandoc.c,v retrieving revision 1.68 retrieving revision 1.72 diff -u -p -r1.68 -r1.72 --- mandoc/mandoc.c 2013/08/08 20:07:47 1.68 +++ mandoc/mandoc.c 2013/12/25 22:45:33 1.72 @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.68 2013/08/08 20:07:47 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.72 2013/12/25 22:45:33 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013 Ingo Schwarze @@ -40,7 +40,7 @@ static char *time2a(time_t); enum mandoc_esc -mandoc_escape(const char **end, const char **start, int *sz) +mandoc_escape(const char const **end, const char const **start, int *sz) { const char *local_start; int local_sz; @@ -93,12 +93,23 @@ mandoc_escape(const char **end, const char **start, in 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; /* + * Escapes taking no arguments at all. + */ + case ('d'): + /* FALLTHROUGH */ + case ('u'): + return(ESCAPE_IGNORE); + + /* * The \z escape is supposed to output the following * character without advancing the cursor position. * Since we are mostly dealing with terminal mode, @@ -416,10 +427,10 @@ mandoc_strdup(const char *ptr) * Parse a quoted or unquoted roff-style request or macro argument. * Return a pointer to the parsed argument, which is either the original * pointer or advanced by one byte in case the argument is quoted. - * Null-terminate the argument in place. + * NUL-terminate the argument in place. * Collapse pairs of quotes inside quoted arguments. * Advance the argument pointer to the next argument, - * or to the null byte terminating the argument line. + * or to the NUL byte terminating the argument line. */ char * mandoc_getarg(struct mparse *parse, char **cpp, int ln, int *pos) @@ -490,7 +501,7 @@ mandoc_getarg(struct mparse *parse, char **cpp, int ln if (1 == quoted) mandoc_msg(MANDOCERR_BADQUOTE, parse, ln, *pos, NULL); - /* Null-terminate this argument and move to the next one. */ + /* NUL-terminate this argument and move to the next one. */ if (pairs) cp[-pairs] = '\0'; if ('\0' != *cp) {