summaryrefslogtreecommitdiff
path: root/case_diffb.c
blob: 9064b8a1dfc0b2514a47f8fda144eb127a8fcdb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "case.h"

int case_diffb(s,len,t)
register char *s;
unsigned int len;
register char *t;
{
  register unsigned char x;
  register unsigned char y;

  while (len > 0) {
    --len;
    x = *s++ - 'A';
    if (x <= 'Z' - 'A') x += 'a'; else x += 'A';
    y = *t++ - 'A';
    if (y <= 'Z' - 'A') y += 'a'; else y += 'A';
    if (x != y)
      return ((int)(unsigned int) x) - ((int)(unsigned int) y);
  }
  return 0;
}