version 1.160, 2010/08/07 20:33:55 |
version 1.162, 2010/08/08 14:51:32 |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
|
#include <assert.h> |
#include <assert.h> |
#include <ctype.h> |
|
#include <stdarg.h> |
#include <stdarg.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 777 mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off |
|
Line 776 mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off |
|
sv = i; |
sv = i; |
|
|
/* |
/* |
* Copy the first word into a nil-terminated buffer. Stop |
* Copy the first word into a nil-terminated buffer. |
* copying when a tab, space, or eoln is encountered. |
* Stop copying when a tab, space, or eoln is encountered. |
*/ |
*/ |
|
|
for (j = 0; j < 4; j++, i++) { |
j = 0; |
if ('\0' == (mac[j] = buf[i])) |
while (j < 4 && '\0' != buf[i] && ' ' != buf[i] && '\t' != buf[i]) |
break; |
mac[j++] = buf[i++]; |
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; |
|
if ( ! mdoc_pmsg(m, ln, i, MANDOCERR_BADCHAR)) |
|
return(0); |
|
i--; |
|
} |
|
|
|
mac[j] = '\0'; |
mac[j] = '\0'; |
|
|
if (j == 4 || j < 2) { |
if (j == 4 || j < 2) { |