commit 50f930063329dea8ca03c00b70d2a1f072d5ee08
parent 9a0350485ca910a93e05773b83be6795d7ffe789
Author: ukai <ukai>
Date: Mon, 26 Nov 2001 09:04:01 +0000
[w3m-dev 02556]
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,8 @@
2001-11-26 Fumitoshi UKAI <ukai@debian.or.jp>
+ * [w3m-dev 02556]
+ * indep.c (strcasestr): strcasestr("", "") should not return NULL
+
* [w3m-dev 02555]
* configure: check strcasestr
* fm.h (_GNU_SOURCE): requires for strcasestr()
diff --git a/indep.c b/indep.c
@@ -177,6 +177,8 @@ strcasestr(const char *s1, const char *s2)
int len1, len2;
if (s2 == NULL)
return (char *)s1;
+ if (*s2 == '\0')
+ return (char *)s1;
len1 = strlen(s1);
len2 = strlen(s2);
while (*s1 && len1 >= len2) {