Annotation of researchv9/libc/stdio/gets.c, revision 1.1

1.1     ! root        1: /* @(#)gets.c  4.1 (Berkeley) 12/21/80 */
        !             2: #include       <stdio.h>
        !             3: 
        !             4: char *
        !             5: gets(s)
        !             6: char *s;
        !             7: {
        !             8:        register c;
        !             9:        register char *cs;
        !            10: 
        !            11:        cs = s;
        !            12:        while ((c = getchar()) != '\n' && c >= 0)
        !            13:                *cs++ = c;
        !            14:        if (c<0 && cs==s)
        !            15:                return(NULL);
        !            16:        *cs++ = '\0';
        !            17:        return(s);
        !            18: }

unix.superglobalmegacorp.com

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