|
|
1.1 ! root 1: int optr; ! 2: ! 3: char obuf[512]; ! 4: ! 5: int nflush; ! 6: ! 7: put(string,n) ! 8: char *string; ! 9: { ! 10: extern utmp; ! 11: int i; ! 12: char *o; ! 13: ! 14: /*printf("%c %d\n",*string,n);/*DEBUG*/ ! 15: ! 16: string--; ! 17: ! 18: if((i = optr + n - 512) >= 0) { ! 19: n =- i; ! 20: o = &obuf[optr] -1; ! 21: while(--n >= 0) ! 22: *++o = *++string; ! 23: optr = 512; ! 24: flsh(1); ! 25: n = i; ! 26: } ! 27: ! 28: o = &obuf[optr] - 1; ! 29: optr =+ n; ! 30: ! 31: while(--n >= 0) { ! 32: *++o = *++string; ! 33: } ! 34: return(0); ! 35: } ! 36: ! 37: flsh(fil) ! 38: { ! 39: extern tp[],utmp; ! 40: ! 41: if(optr <= 0) return(optr); ! 42: ! 43: nflush++; ! 44: if(write(tp[0],obuf,optr) != optr) ! 45: return(-1); ! 46: optr = 0; ! 47: return(0); ! 48: } ! 49:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.