gobble = 0;
cook_buf(fp)	FILE *fp;{	int ch, gobble, line, prev;	line = gobble = 0;	for (prev = '\n'; (ch = getc(fp)) != EOF; prev = ch) {		if (prev == '\n') {			if (ch == '\n') {				if (sflag) {					if (!gobble && putchar(ch) == EOF)						break;					gobble = 1;					continue;				}				if (nflag && !bflag) {					(void)fprintf(stdout, "%6d\t", ++line);					if (ferror(stdout))						break;				}			} else if (nflag) {				(void)fprintf(stdout, "%6d\t", ++line);				if (ferror(stdout))					break;			}		}		gobble = 0;		if (ch == '\n') {			if (eflag)				if (putchar('$') == EOF)					break;		} else if (ch == '\t') {			if (tflag) {				if (putchar('^') == EOF || putchar('I') == EOF)					break;				continue;			}		} else if (vflag) {			if (!isascii(ch)) {				if (putchar('M') == EOF || putchar('-') == EOF)					break;				ch = toascii(ch);			}			if (iscntrl(ch)) {				if (putchar('^') == EOF ||				    putchar(ch == '\177' ? '?' :				    ch | 0100) == EOF)					break;				continue;			}		}		if (putchar(ch) == EOF)			break;	}	if (ferror(fp)) {		warn("%s", filename);		rval = 1;		clearerr(fp);	}	if (ferror(stdout))		err(1, "stdout");}