diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-26 09:01:08 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-26 09:01:08 +0000 |
commit | b136c763a15a19e9fea22d53645f1c4944a05cee (patch) | |
tree | 8647dd4cd9e4d9fd415a03616ee71e4830c7e136 /indep.c | |
parent | [w3m-dev 02553] (diff) | |
download | w3m-b136c763a15a19e9fea22d53645f1c4944a05cee.tar.gz w3m-b136c763a15a19e9fea22d53645f1c4944a05cee.zip |
[w3m-dev 02555]
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to 'indep.c')
-rw-r--r-- | indep.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: indep.c,v 1.9 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: indep.c,v 1.10 2001/11/26 09:01:08 ukai Exp $ */ #include "fm.h" #include <stdio.h> #include <pwd.h> @@ -169,21 +169,25 @@ expandPath(char *name) return extpath->ptr; } +#ifndef HAVE_STRCASESTR /* string search using the simplest algorithm */ char * -strcasestr(char *s1, char *s2) +strcasestr(const char *s1, const char *s2) { int len1, len2; + if (s2 == NULL) + return (char *)s1; len1 = strlen(s1); len2 = strlen(s2); while (*s1 && len1 >= len2) { if (strncasecmp(s1, s2, len2) == 0) - return s1; + return (char *)s1; s1++; len1--; } return 0; } +#endif static int strcasematch(char *s1, char *s2) |