From 259d1f18be2e57a9ec6e768989571f6c8f82aed7 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Fri, 7 Jun 2002 15:46:44 +0000 Subject: [w3m-dev 03207] strchr(), strcasecmp(), and strncasecmp() * etc.c (strchr): removed (strcasecmp): removed (strncasecmp): removed * indep.c (strchr): moved, cast (strcasecmp): moved, fix the case that s1 = "" (strncasecmp): moved, fix the case that s1 is shorter than s2 * indep.h (strchr): added (strcasecmp): added (strncasecmp): added From: Kiyokazu SUTO --- etc.c | 50 +------------------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) (limited to 'etc.c') diff --git a/etc.c b/etc.c index c2b83e4..7af9869 100644 --- a/etc.c +++ b/etc.c @@ -1,4 +1,4 @@ -/* $Id: etc.c,v 1.21 2002/03/07 16:10:22 ukai Exp $ */ +/* $Id: etc.c,v 1.22 2002/06/07 15:46:44 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -25,54 +25,6 @@ #endif /* __WATT32__ */ -#ifndef HAVE_STRCHR -char * -strchr(char *s, char c) -{ - while (*s) { - if (*s == c) - return s; - s++; - } - return NULL; -} -#endif /* not HAVE_STRCHR */ - -#ifndef HAVE_STRCASECMP -int -strcasecmp(char *s1, char *s2) -{ - int x; - while (*s1) { - x = tolower(*s1) - tolower(*s2); - if (x != 0) - break; - s1++; - s2++; - } - if (x != 0) - return x; - return -tolower(*s2); -} - -int -strncasecmp(char *s1, char *s2, int n) -{ - int x; - while (*s1 && n) { - x = tolower(*s1) - tolower(*s2); - if (x != 0) - break; - s1++; - s2++; - n--; - } - if (x != 0) - return x; - return 0; -} -#endif /* not HAVE_STRCASECMP */ - int columnSkip(Buffer *buf, int offset) { -- cgit v1.2.3