Annotation of 43BSDReno/usr.bin/learn/lrntee/lrntee.c, revision 1.1

1.1     ! root        1: #ifndef lint
        !             2: static char sccsid[] = "@(#)lrntee.c   4.3     (Berkeley)      5/15/86";
        !             3: #endif not lint
        !             4: 
        !             5: main()
        !             6: {
        !             7:        int f;
        !             8:        char c;
        !             9: 
        !            10:        f = creat(".ocopy", 0666);
        !            11:        while (read(0, &c, 1) == 1) {
        !            12:                write (1, &c, 1);
        !            13:                put(c, f);
        !            14:        }
        !            15:        fl(f);
        !            16:        close(f);
        !            17: }
        !            18: 
        !            19: static char ln[512];
        !            20: char *p = ln;
        !            21: put(c, f)
        !            22: {
        !            23:        *p++ = c;
        !            24:        if (c == '\n') {
        !            25:                fl(f);
        !            26:                p=ln;
        !            27:        }
        !            28: }
        !            29: fl(f)
        !            30: {
        !            31:        register char *s;
        !            32: 
        !            33:        s = ln;
        !            34:        while (*s == '%' && *(s+1) == ' ')
        !            35:                s += 2;
        !            36:        write(f, s, p-s);
        !            37: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.