Annotation of researchv10no/cmd/und.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: 
        !             3: main(argc, argv)
        !             4: char **argv;
        !             5: {
        !             6:        register bflg, c, n;
        !             7:        int undc=8;
        !             8: 
        !             9:        bflg = 1;
        !            10:        if (argc>1 && argv[1][0]=='-') {
        !            11:                undc = atoi(&argv[1][1]);
        !            12:                if (undc>16)
        !            13:                        undc = 0;
        !            14:                argc--;
        !            15:                argv++;
        !            16:        }
        !            17:        if (argc>1) {
        !            18:                if ((freopen(argv[1], "r", stdin))==NULL) {
        !            19:                        fprintf(stderr, "Cannot open %s\n", argv[1]);
        !            20:                        exit(1);
        !            21:                }
        !            22:        }
        !            23:        while((c = getchar()) != EOF) {
        !            24:                if(c == '\n' || c == 014) {
        !            25:                        bflg = 1;
        !            26:                        putchar(c);
        !            27:                        continue;
        !            28:                }
        !            29:                if(bflg) {
        !            30:                        for (n=0; n<undc; n++)
        !            31:                                putchar('\b');
        !            32:                        bflg = 0;
        !            33:                }
        !            34:                putchar(c);
        !            35:        }
        !            36:        return(0);
        !            37: }

unix.superglobalmegacorp.com

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