25 |
|
|
26 |
|
#define isblnk(c) (igneol ? isspace(c) : (c)==' '||(c)=='\t') |
27 |
|
|
28 |
< |
#define INBSIZ 4096 /* longest record */ |
28 |
> |
#define INBSIZ 16384 /* longest record */ |
29 |
|
#define MAXCOL 32 /* number of columns recorded */ |
30 |
|
|
31 |
|
/* field type specifications */ |
210 |
|
} |
211 |
|
|
212 |
|
if (noinput) { /* produce a single output record */ |
213 |
+ |
if (i < argc) { |
214 |
+ |
eputs(argv[0]); |
215 |
+ |
eputs(": file argument(s) incompatible with -n\n"); |
216 |
+ |
quit(1); |
217 |
+ |
} |
218 |
|
eclock++; |
219 |
|
putout(); |
220 |
|
quit(0); |
459 |
|
eputs(": cannot open\n"); |
460 |
|
quit(1); |
461 |
|
} |
462 |
< |
res = read(fd, inpbuf+1, INBSIZ-1); |
462 |
> |
res = read(fd, inpbuf+2, INBSIZ-2); |
463 |
|
if (res <= 0 || res >= INBSIZ-1) { |
464 |
|
eputs(spec); |
465 |
|
if (res < 0) |
471 |
|
quit(1); |
472 |
|
} |
473 |
|
close(fd); |
474 |
< |
(inptr=inpbuf+1)[res] = '\0'; |
474 |
> |
(inptr=inpbuf+2)[res] = '\0'; |
475 |
|
} |
476 |
|
f = &fmt; /* get fields */ |
477 |
|
while ((res = readfield(&inptr)) != F_NUL) { |
637 |
|
{ |
638 |
|
int eatline; |
639 |
|
register struct field *f; |
640 |
< |
|
640 |
> |
|
641 |
|
while (ipb.chr != EOF) { |
637 |
– |
eatline = !igneol && ipb.chr != '\n'; |
642 |
|
if (blnkeq) /* beware of nbsynch() */ |
643 |
|
while (isblnk(ipb.chr)) |
644 |
|
resetinp(); |
645 |
+ |
eatline = (!igneol && ipb.chr != '\n'); |
646 |
|
clearrec(); /* start with fresh record */ |
647 |
|
for (f = inpfmt; f != NULL; f = f->next) |
648 |
|
if (getfield(f) == -1) |