File: wnseqn.c

package info (click to toggle)
libwn6 6.0-17
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 6,012 kB
  • ctags: 3,903
  • sloc: ansic: 45,078; makefile: 960; csh: 274; sh: 17
file content (54 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/****************************************************************************

COPYRIGHT NOTICE:

  The source code in this file is provided free of charge
  to the author's consulting clients.  It is in the
  public domain and therefore may be used by anybody for
  any purpose.

AUTHOR:

  Will Naylor

****************************************************************************/
#include <ctype.h>
#include "wnlib.h"

#include "wneq.h"



bool wn_streqnc(register char s1[],register char s2[])
{
  register char c1,c2;

  for(;;)
  {
    c1 = *s1;
    c2 = *s2;
    
    if(islower(c1))      /* upcase c1 */
    {
      c1 = toupper(c1);
    }
    if(islower(c2))      /* upcase c2 */
    {
      c2 = toupper(c2);
    }

    if(c1 != c2)
    {
      return(FALSE);
    }
    
    if(c1 == '\0')
    {
      return(TRUE);
    }

    ++s1; ++s2;
  }
}