version 1.36, 2003/05/08 12:37:13 |
version 1.37, 2003/08/15 23:09:57 |
|
|
#include <string.h> |
#include <string.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <ctype.h> |
|
|
/* |
/* |
* Open a file for reading. |
* Open a file for reading. |
|
|
d_makename(LINE *lp, char *fn, int len) |
d_makename(LINE *lp, char *fn, int len) |
{ |
{ |
int i; |
int i; |
char *p, *np; |
char *p, *ep; |
|
|
strlcpy(fn, curbp->b_fname, len); |
strlcpy(fn, curbp->b_fname, len); |
p = lp->l_text; |
p = lp->l_text; |
|
ep = lp->l_text + llength(lp); |
for (i = 0; i < NAME_FIELD; i++) { |
for (i = 0; i < NAME_FIELD; i++) { |
np = strpbrk(p, "\t "); |
while (p < ep && isspace(*p)) |
if (np == NULL) |
|
return ABORT; |
|
p = np + 1; |
|
while (*p != '\0' && strchr("\t ", *p)) |
|
p++; |
p++; |
|
while (p < ep && !isspace(*p)) |
|
p++; |
|
while (p < ep && isspace(*p)) |
|
p++; |
|
if (p == ep) |
|
return (ABORT); |
} |
} |
strlcat(fn, p, len); |
strlcat(fn, p, len); |
return lgetc(lp, 2) == 'd'; |
return lgetc(lp, 2) == 'd'; |