--- ray/src/cal/rcalc.c 2004/10/11 10:02:15 1.14 +++ ray/src/cal/rcalc.c 2005/02/16 17:20:22 1.17 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rcalc.c,v 1.14 2004/10/11 10:02:15 greg Exp $"; +static const char RCSid[] = "$Id: rcalc.c,v 1.17 2005/02/16 17:20:22 greg Exp $"; #endif /* * rcalc.c - record calculator program. @@ -25,7 +25,7 @@ static const char RCSid[] = "$Id: rcalc.c,v 1.14 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 */ @@ -210,6 +210,11 @@ eputs(" [-b][-l][-n][-p][-w][-u][-tS][-s svar=sval][-e } if (noinput) { /* produce a single output record */ + if (i < argc) { + eputs(argv[0]); + eputs(": file argument(s) incompatible with -n\n"); + quit(1); + } eclock++; putout(); quit(0); @@ -634,10 +639,10 @@ getrec(void) /* get next record from file */ 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)