=================================================================== RCS file: /cvs/mandoc/mandoc.c,v retrieving revision 1.45 retrieving revision 1.48 diff -u -p -r1.45 -r1.48 --- mandoc/mandoc.c 2011/04/09 15:29:40 1.45 +++ mandoc/mandoc.c 2011/04/19 16:38:48 1.48 @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.45 2011/04/09 15:29:40 kristaps Exp $ */ +/* $Id: mandoc.c,v 1.48 2011/04/19 16:38:48 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -95,15 +95,6 @@ numescape(const char *start) return(++i); } -/* - * Handle an escaped sequeence. This should be called with any - * string subsequent a `\'. Pass a pointer to this substring as "end"; - * it will be set to the supremum of the parsed escape sequence. If - * this returns ESCAPE_ERROR, the string is bogus and should be thrown - * away. If not ESCAPE_ERROR or ESCAPE_IGNORE, "start" is set to the - * first relevant character of the substring (font, glyph, whatever) of - * length sz. Both "start" and "sz" may be NULL. - */ enum mandoc_esc mandoc_escape(const char **end, const char **start, int *sz) { @@ -116,10 +107,9 @@ mandoc_escape(const char **end, const char **start, in rstart = cp; if (start) *start = rstart; - i = 0; + i = lim = 0; gly = ESCAPE_ERROR; - term = '\0'; - numeric = 0; + term = numeric = '\0'; switch ((c = cp[i++])) { /* @@ -379,6 +369,7 @@ out: gly = ESCAPE_FONTROMAN; break; } + break; case (ESCAPE_SPECIAL): if (1 != rlim) break; @@ -467,11 +458,11 @@ mandoc_getarg(struct mparse *parse, char **cpp, int ln /* Quoting can only start with a new word. */ start = *cpp; + quoted = 0; if ('"' == *start) { quoted = 1; start++; - } else - quoted = 0; + } pairs = 0; white = 0;