~vcs-imports/clamav/main-old

« back to all changes in this revision

Viewing changes to libclamav/zziplib/strc.c

  • Committer: nervoso
  • Date: 2006-05-21 15:16:39 UTC
  • Revision ID: Arch-1:clamav@arch.ubuntu.com%clamav--MAIN--0--patch-1959
repository moved to cvs.clamav.net

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
2
 
   This file is part of the GNU C Library.
3
 
 
4
 
   Slightly modified for ClamAV by Tomasz Kojm.
5
 
 
6
 
   The GNU C Library is free software; you can redistribute it and/or
7
 
   modify it under the terms of the GNU Library General Public License as
8
 
   published by the Free Software Foundation; either version 2 of the
9
 
   License, or (at your option) any later version.
10
 
 
11
 
   The GNU C Library is distributed in the hope that it will be useful,
12
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
   Library General Public License for more details.
15
 
 
16
 
   You should have received a copy of the GNU Library General Public
17
 
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
18
 
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
 
   Boston, MA 02111-1307, USA.  */
20
 
 
21
 
#if HAVE_CONFIG_H
22
 
#include "clamav-config.h"
23
 
#endif
24
 
 
25
 
#ifndef C_DARWIN
26
 
 
27
 
#include <ctype.h>
28
 
#include <string.h>
29
 
 
30
 
/* Compare S1 and S2, ignoring case, returning less than, equal to or
31
 
   greater than zero if S1 is lexicographically less than,
32
 
   equal to or greater than S2.  */
33
 
int strcasecmp (s1, s2)
34
 
     const char *s1;
35
 
     const char *s2;
36
 
{
37
 
  const unsigned char *p1 = (const unsigned char *) s1;
38
 
  const unsigned char *p2 = (const unsigned char *) s2;
39
 
  unsigned char c1, c2;
40
 
 
41
 
  if (p1 == p2)
42
 
    return 0;
43
 
 
44
 
  do
45
 
    {
46
 
      c1 = tolower(*p1++);
47
 
      c2 = tolower(*p2++);
48
 
      if (c1 == '\0')
49
 
        break;
50
 
    }
51
 
  while (c1 == c2);
52
 
 
53
 
  return c1 - c2;
54
 
}
55
 
#endif