} else rlines(fp, off, sbp); else if (off == 0) { while (getc(fp) != EOF);
} else if (rlines(fp, off, sbp) != 0) lines(fp, off); } else if (off == 0) { while (getc(fp) != EOF) ;
forward(fp, style, off, sbp)	FILE *fp;	enum STYLE style;	long off;	struct stat *sbp;{	register int ch;	struct stat nsb;	switch(style) {	case FBYTES:		if (off == 0)			break;		if (S_ISREG(sbp->st_mode)) {			if (sbp->st_size < off)				off = sbp->st_size;			if (fseek(fp, off, SEEK_SET) == -1) {				ierr();				return;			}		} else while (off--)			if ((ch = getc(fp)) == EOF) {				if (ferror(fp)) {					ierr();					return;				}				break;			}		break;	case FLINES:		if (off == 0)			break;		for (;;) {			if ((ch = getc(fp)) == EOF) {				if (ferror(fp)) {					ierr();					return;				}				break;			}			if (ch == '\n' && !--off)				break;		}		break;	case RBYTES:		if (S_ISREG(sbp->st_mode)) {			if (sbp->st_size >= off &&			    fseek(fp, -off, SEEK_END) == -1) {				ierr();				return;			}		} else if (off == 0) {			while (getc(fp) != EOF);			if (ferror(fp)) {				ierr();				return;			}		} else			bytes(fp, off);		break;	case RLINES:		if (S_ISREG(sbp->st_mode))			if (!off) {				if (fseek(fp, 0L, SEEK_END) == -1) {					ierr();					return;				}			} else				rlines(fp, off, sbp);		else if (off == 0) {			while (getc(fp) != EOF);			if (ferror(fp)) {				ierr();				return;			}		} else			lines(fp, off);		break;	}	for (;;) {		while (!feof(fp) && (ch = getc(fp)) != EOF)			if (putchar(ch) == EOF)				oerr();		if (ferror(fp)) {			ierr();			return;		}		(void)fflush(stdout);		if (!fflag)			break;		sleep(1);		clearerr(fp);		if (stat(fname, &nsb) != 0)			continue;		/* Reopen file if the inode changes or file was truncated */		if (nsb.st_ino != sbp->st_ino) {			warnx("%s has been replaced, reopening.", fname);			if ((fp = freopen(fname, "r", fp)) == NULL) {				ierr();				return;			}			(void)memcpy(sbp, &nsb, sizeof(nsb));		} else if (nsb.st_size < sbp->st_size) {			warnx("%s has been truncated, resetting.", fname);			rewind(fp);			(void)memcpy(sbp, &nsb, sizeof(nsb));		}	}}