diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
| commit | 69aec538b456402170dc723af417ba5c05389c32 (patch) | |
| tree | e6f34c543f17c6392447ea337b2e2868212424d1 /case_diffs.c | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'case_diffs.c')
| -rw-r--r-- | case_diffs.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/case_diffs.c b/case_diffs.c new file mode 100644 index 0000000..212c645 --- /dev/null +++ b/case_diffs.c | |||
| @@ -0,0 +1,19 @@ | |||
| 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 | } | ||
