/* @(#)lff.c--trim leading/trailing lff's and lf's */ /* * special code added for processing output from basic 6.8.1 * the basic outputs each line padded to the buffer size with * spaces followed by a null followed by the control character. * all spaces and nulls preceeding the ctl character are dropped. */ #include char fbuf[1024]; extern int errno; main() { register char *fp,*fps,*fpe; register int c; int first=1; fp=fps=fbuf; fpe=fps+sizeof(fbuf); while((c=getchar())!=EOF) { switch(c) { case '\f': if(first) { fp=fps; continue; } case '\n': case '\r': while(fp>fps && (fp[-1]=='\0' || fp[-1]==' ')) fp--; case ' ': case '\0': if(fp