=================================================================== RCS file: /cvs/mandoc/mandoc.c,v retrieving revision 1.70 retrieving revision 1.73 diff -u -p -r1.70 -r1.73 --- mandoc/mandoc.c 2013/11/10 21:34:04 1.70 +++ mandoc/mandoc.c 2013/12/26 02:55:28 1.73 @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.70 2013/11/10 21:34:04 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.73 2013/12/26 02:55:28 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013 Ingo Schwarze @@ -102,6 +102,14 @@ mandoc_escape(const char const **end, const char const 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, @@ -157,12 +165,16 @@ mandoc_escape(const char const **end, const char const /* FALLTHROUGH */ case ('b'): /* FALLTHROUGH */ + case ('B'): + /* FALLTHROUGH */ case ('D'): /* FALLTHROUGH */ case ('o'): /* FALLTHROUGH */ case ('R'): /* FALLTHROUGH */ + case ('w'): + /* FALLTHROUGH */ case ('X'): /* FALLTHROUGH */ case ('Z'): @@ -177,8 +189,6 @@ mandoc_escape(const char const **end, const char const * These escapes are of the form \X'N', where 'X' is the trigger * and 'N' resolves to a numerical expression. */ - case ('B'): - /* FALLTHROUGH */ case ('h'): /* FALLTHROUGH */ case ('H'): @@ -186,19 +196,15 @@ mandoc_escape(const char const **end, const char const case ('L'): /* FALLTHROUGH */ case ('l'): - gly = ESCAPE_NUMBERED; /* FALLTHROUGH */ case ('S'): /* FALLTHROUGH */ case ('v'): /* FALLTHROUGH */ - case ('w'): - /* FALLTHROUGH */ case ('x'): if ('\'' != **start) return(ESCAPE_ERROR); - if (ESCAPE_ERROR == gly) - gly = ESCAPE_IGNORE; + gly = ESCAPE_IGNORE; *start = ++*end; term = '\''; break; @@ -419,10 +425,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) @@ -493,7 +499,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) {