summaryrefslogtreecommitdiffstats
path: root/case_diffb.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
committermanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
commit69aec538b456402170dc723af417ba5c05389c32 (patch)
treee6f34c543f17c6392447ea337b2e2868212424d1 /case_diffb.c
downloadqmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz
qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2
qmail-69aec538b456402170dc723af417ba5c05389c32.zip
qmail 1.03 import
Diffstat (limited to 'case_diffb.c')
-rw-r--r--case_diffb.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/case_diffb.c b/case_diffb.c
new file mode 100644
index 0000000..9064b8a
--- /dev/null
+++ b/case_diffb.c
@@ -0,0 +1,21 @@
1#include "case.h"
2
3int case_diffb(s,len,t)
4register char *s;
5unsigned int len;
6register char *t;
7{
8 register unsigned char x;
9 register unsigned char y;
10
11 while (len > 0) {
12 --len;
13 x = *s++ - 'A';
14 if (x <= 'Z' - 'A') x += 'a'; else x += 'A';
15 y = *t++ - 'A';
16 if (y <= 'Z' - 'A') y += 'a'; else y += 'A';
17 if (x != y)
18 return ((int)(unsigned int) x) - ((int)(unsigned int) y);
19 }
20 return 0;
21}