pkgsrc-wip/slocate/patches/patch-ab

33 lines
623 B
Text
Raw Normal View History

$NetBSD: patch-ab,v 1.1.1.1 2003/05/31 09:37:34 poppnk Exp $
--- main.c.orig 2003-01-25 04:39:48.000000000 +0000
+++ main.c 2003-05-30 15:05:50.000000000 +0000
@@ -103,6 +103,27 @@
# undef FNM_CASEFOLD
#endif
+#ifndef HAVE_STRCASESTR
+char *
+ strcasestr(char *one, char *two)
+{
+ char *a,*b,*ret;
+ int la,lb,i=0;
+
+ if (!one||!two) return NULL;
+
+ a=strdup(one); b=strdup(two);
+ la=strlen(one); lb=strlen(two);
+ do { a[i]=toupper(a[i]); } while(a[++i]); i=0;
+ do { b[i]=toupper(b[i]); } while(b[++i]);
+
+ ret=strstr(a,b);
+
+ free (a); free(b);
+ return(ret);
+}
+#endif
+
/* GLOBALS */