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_starts.c | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'case_starts.c')
| -rw-r--r-- | case_starts.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/case_starts.c b/case_starts.c new file mode 100644 index 0000000..2278a0a --- /dev/null +++ b/case_starts.c | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #include "case.h" | ||
| 2 | |||
| 3 | int case_starts(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 (!y) return 1; | ||
| 16 | if (x != y) return 0; | ||
| 17 | } | ||
| 18 | } | ||
