source: git/src/strcasecmp.c @ 89231c4

RELEASE/1.0RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-data
Last change on this file since 89231c4 was 89231c4, checked in by Olly Betts <olly@…>, 24 years ago

Updated GPL info (now has correct address for FSF)

git-svn-id: file:///home/survex-svn/survex/trunk@378 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/* portable case insensitive string compare */
2/* Copyright (C) Olly Betts 1994,1999
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18
19#include <ctype.h>
20
21/* What about top bit set chars? */
22int strcasecmp(const char *s1, const char *s2) {
23   register c1, c2;
24   do {
25      c1 = *s1++;
26      c2 = *s2++;
27   } while (c1 && toupper(c1) == toupper(c2));
28   /* now calculate real difference */
29   return c1 - c2;
30}
Note: See TracBrowser for help on using the repository browser.