=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc.c,v retrieving revision 1.62 retrieving revision 1.63 diff -c -r1.62 -r1.63 *** src/usr.bin/mandoc/mdoc.c 2010/07/16 00:34:33 1.62 --- src/usr.bin/mandoc/mdoc.c 2010/08/07 18:06:45 1.63 *************** *** 1,4 **** ! /* $Id: mdoc.c,v 1.62 2010/07/16 00:34:33 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze --- 1,4 ---- ! /* $Id: mdoc.c,v 1.63 2010/08/07 18:06:45 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze *************** *** 760,770 **** i = offs; ! /* Accept whitespace after the initial control char. */ ! if (' ' == buf[i]) { i++; ! while (buf[i] && ' ' == buf[i]) i++; if ('\0' == buf[i]) return(1); --- 760,770 ---- i = offs; ! /* Accept tabs/whitespace after the initial control char. */ ! if (' ' == buf[i] || '\t' == buf[i]) { i++; ! while (buf[i] && (' ' == buf[i] || '\t' == buf[i])) i++; if ('\0' == buf[i]) return(1); *************** *** 772,786 **** sv = i; ! /* Copy the first word into a nil-terminated buffer. */ 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; --- 772,790 ---- sv = i; ! /* ! * 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] || '\t' == buf[i]) break; /* Check for invalid characters. */ + /* TODO: remove me, already done in main.c. */ if (isgraph((u_char)buf[i])) continue; *************** *** 803,809 **** return(1); } ! /* The macro is sane. Jump to the next word. */ while (buf[i] && ' ' == buf[i]) i++; --- 807,818 ---- return(1); } ! /* Disregard the first trailing tab, if applicable. */ ! ! if ('\t' == buf[i]) ! i++; ! ! /* Jump to the next non-whitespace word. */ while (buf[i] && ' ' == buf[i]) i++;