=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.156 retrieving revision 1.158 diff -u -p -r1.156 -r1.158 --- mandoc/roff.c 2011/07/27 12:41:02 1.156 +++ mandoc/roff.c 2011/07/27 13:47:26 1.158 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.156 2011/07/27 12:41:02 kristaps Exp $ */ +/* $Id: roff.c,v 1.158 2011/07/27 13:47:26 kristaps Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -538,8 +538,10 @@ roff_parsetext(char *p) if (ESCAPE_ERROR == esc) break; continue; - } else if ('-' != *p || p == start) + } else if ('-' != *p || p == start) { + p++; continue; + } l = *(p - 1); r = *(p + 1); @@ -1519,11 +1521,12 @@ roff_getstrn(const struct roff *r, const char *name, s { const struct roffstr *n; - n = r->first_string; - while (n && (strncmp(name, n->name, len) || '\0' != n->name[(int)len])) - n = n->next; + for (n = r->first_string; n; n = n->next) + if (0 == strncmp(name, n->name, len) && + '\0' == n->name[(int)len]) + return(n->string); - return(n ? n->string : NULL); + return(NULL); } static void