=================================================================== RCS file: /cvs/mandoc/man.c,v retrieving revision 1.84 retrieving revision 1.86 diff -u -p -r1.84 -r1.86 --- mandoc/man.c 2010/07/22 23:03:15 1.84 +++ mandoc/man.c 2010/08/08 14:51:32 1.86 @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.84 2010/07/22 23:03:15 kristaps Exp $ */ +/* $Id: man.c,v 1.86 2010/08/08 14:51:32 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -481,23 +480,14 @@ man_pmacro(struct man *m, int ln, char *buf, int offs) ppos = i; - /* Copy the first word into a nil-terminated buffer. */ + /* + * Copy the first word into a nil-terminated buffer. + * Stop copying when a tab, space, or eoln is encountered. + */ - for (j = 0; j < 4; j++, i++) { - if ('\0' == (mac[j] = buf[i])) - break; - else if (' ' == buf[i]) - break; - - /* Check for invalid characters. */ - - if (isgraph((u_char)buf[i])) - continue; - if ( ! man_pmsg(m, ln, i, MANDOCERR_BADCHAR)) - return(0); - i--; - } - + j = 0; + while (j < 4 && '\0' != buf[i] && ' ' != buf[i] && '\t' != buf[i]) + mac[j++] = buf[i++]; mac[j] = '\0'; if (j == 4 || j < 1) {