aboutsummaryrefslogtreecommitdiffstats
path: root/indep.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-26 09:01:08 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-26 09:01:08 +0000
commitb136c763a15a19e9fea22d53645f1c4944a05cee (patch)
tree8647dd4cd9e4d9fd415a03616ee71e4830c7e136 /indep.c
parent[w3m-dev 02553] (diff)
downloadw3m-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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/indep.c b/indep.c
index e08d7d0..d935b54 100644
--- a/indep.c
+++ b/indep.c
@@ -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)