* stor-layout.c (place_field): Revert erroneous commit.
[official-gcc.git] / libf2c / libF77 / s_cmp.c
blob5b43c9edb9c3fa8694016894fad772ac241871c3
1 #include "f2c.h"
3 /* compare two strings */
5 integer
6 s_cmp (char *a0, char *b0, ftnlen la, ftnlen lb)
8 register unsigned char *a, *aend, *b, *bend;
9 a = (unsigned char *) a0;
10 b = (unsigned char *) b0;
11 aend = a + la;
12 bend = b + lb;
14 if (la <= lb)
16 while (a < aend)
17 if (*a != *b)
18 return (*a - *b);
19 else
21 ++a;
22 ++b;
25 while (b < bend)
26 if (*b != ' ')
27 return (' ' - *b);
28 else
29 ++b;
32 else
34 while (b < bend)
35 if (*a == *b)
37 ++a;
38 ++b;
40 else
41 return (*a - *b);
42 while (a < aend)
43 if (*a != ' ')
44 return (*a - ' ');
45 else
46 ++a;
48 return (0);