source: git/src/strcasecmp.c @ 2e70979

RELEASE/1.0RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning
Last change on this file since 2e70979 was 846746e, checked in by Olly Betts <olly@…>, 24 years ago

Added GPL text to all sources
Pruned various defunct source

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

  • Property mode set to 100644
File size: 1.0 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
5 * modify it under the terms of the GNU General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (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 GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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.