Annotation of 3BSD/cmd/learn/tee.c, revision 1.1

1.1     ! root        1: #include <pagsiz.h>
        !             2: #define BUFSIZ BSIZE
        !             3: main()
        !             4: {
        !             5:        int f, c;
        !             6: 
        !             7:        f = creat(".ocopy", 0666);
        !             8:        while (read(0, &c, 1) == 1) {
        !             9:                write (1, &c, 1);
        !            10:                put(c, f);
        !            11:        }
        !            12:        fl(f);
        !            13:        close(f);
        !            14: }
        !            15: 
        !            16: static char ln[BUFSIZ];
        !            17: char *p = ln;
        !            18: put(c, f)
        !            19: {
        !            20:        *p++ = c;
        !            21:        if (c == '\n') {
        !            22:                fl(f);
        !            23:                p=ln;
        !            24:        }
        !            25: }
        !            26: fl(f)
        !            27: {
        !            28:        register char *s;
        !            29: 
        !            30:        s = ln;
        !            31:        while (*s == '$' && *(s+1) == ' ')
        !            32:                s += 2;
        !            33:        write(f, s, p-s);
        !            34: }

unix.superglobalmegacorp.com

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