summaryrefslogtreecommitdiff
path: root/case_starts.c
blob: 2278a0a49c65b42bcd70eae5df4c8e39e0b14616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "case.h"

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

  for (;;) {
    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 (!y) return 1;
    if (x != y) return 0;
  }
}