Annotation of 41BSD/lib/libF77/s_cmp.c, revision 1.1

1.1     ! root        1: int s_cmp(a, b, la, lb)        /* compare two strings */
        !             2: register char *a, *b;
        !             3: long int la, lb;
        !             4: {
        !             5: register char *aend, *bend;
        !             6: aend = a + la;
        !             7: bend = b + lb;
        !             8: 
        !             9: if(la <= lb)
        !            10:        {
        !            11:        while(a < aend)
        !            12:                if(*a != *b)
        !            13:                        return( *a - *b );
        !            14:                else
        !            15:                        { ++a; ++b; }
        !            16: 
        !            17:        while(b < bend)
        !            18:                if(*b != ' ')
        !            19:                        return( ' ' - *b );
        !            20:                else    ++b;
        !            21:        }
        !            22: 
        !            23: else
        !            24:        {
        !            25:        while(b < bend)
        !            26:                if(*a == *b)
        !            27:                        { ++a; ++b; }
        !            28:                else
        !            29:                        return( *a - *b );
        !            30:        while(a < aend)
        !            31:                if(*a != ' ')
        !            32:                        return(*a - ' ');
        !            33:                else    ++a;
        !            34:        }
        !            35: return(0);
        !            36: }

unix.superglobalmegacorp.com

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