Annotation of 3BSD/libF77/s_cmp.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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