Commit | Line | Data |
---|---|---|
1 | #include "case.h" | |
2 | ||
3 | int case_diffs(s,t) | |
4 | register char *s; | |
5 | register char *t; | |
6 | { | |
7 | register unsigned char x; | |
8 | register unsigned char y; | |
9 | ||
10 | for (;;) { | |
11 | x = *s++ - 'A'; | |
12 | if (x <= 'Z' - 'A') x += 'a'; else x += 'A'; | |
13 | y = *t++ - 'A'; | |
14 | if (y <= 'Z' - 'A') y += 'a'; else y += 'A'; | |
15 | if (x != y) break; | |
16 | if (!x) break; | |
17 | } | |
18 | return ((int)(unsigned int) x) - ((int)(unsigned int) y); | |
19 | } |