--- ray/src/cal/rcalc.c 2004/06/09 16:00:13 1.13 +++ ray/src/cal/rcalc.c 2004/12/10 05:52:14 1.16 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rcalc.c,v 1.13 2004/06/09 16:00:13 greg Exp $"; +static const char RCSid[] = "$Id: rcalc.c,v 1.16 2004/12/10 05:52:14 greg Exp $"; #endif /* * rcalc.c - record calculator program. @@ -25,7 +25,7 @@ static const char RCSid[] = "$Id: rcalc.c,v 1.13 2004/ #define isblnk(c) (igneol ? isspace(c) : (c)==' '||(c)=='\t') -#define INBSIZ 4096 /* longest record */ +#define INBSIZ 16384 /* longest record */ #define MAXCOL 32 /* number of columns recorded */ /* field type specifications */ @@ -454,7 +454,7 @@ int output eputs(": cannot open\n"); quit(1); } - res = read(fd, inpbuf+1, INBSIZ-1); + res = read(fd, inpbuf+2, INBSIZ-2); if (res <= 0 || res >= INBSIZ-1) { eputs(spec); if (res < 0) @@ -466,7 +466,7 @@ int output quit(1); } close(fd); - (inptr=inpbuf+1)[res] = '\0'; + (inptr=inpbuf+2)[res] = '\0'; } f = &fmt; /* get fields */ while ((res = readfield(&inptr)) != F_NUL) { @@ -632,12 +632,12 @@ getrec(void) /* get next record from file */ { int eatline; register struct field *f; - + while (ipb.chr != EOF) { - eatline = !igneol && ipb.chr != '\n'; if (blnkeq) /* beware of nbsynch() */ while (isblnk(ipb.chr)) resetinp(); + eatline = (!igneol && ipb.chr != '\n'); clearrec(); /* start with fresh record */ for (f = inpfmt; f != NULL; f = f->next) if (getfield(f) == -1)