From 64c8c730d752e90591b44384ef4663fa06db4213 Mon Sep 17 00:00:00 2001 From: ocean Date: Thu, 20 Oct 2005 02:22:50 +0000 Subject: * eval.c, file.c, ruby.c: removed strchr, strrchr, strstr definition because they are defined in missing.h. * missing.h, missing/strchr.c, missing/strstr.c: ANSI styled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/strstr.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'missing/strstr.c') diff --git a/missing/strstr.c b/missing/strstr.c index 1673518f06..2e9c282fb1 100644 --- a/missing/strstr.c +++ b/missing/strstr.c @@ -1,20 +1,19 @@ /* public domain rewrite of strstr(3) */ char * -strstr(haystack, needle) - char *haystack, *needle; +strstr(const char *haystack, const char *needle) { - char *hend; - char *a, *b; + const char *hend; + const char *a, *b; - if (*needle == 0) return haystack; + if (*needle == 0) return (char *)haystack; hend = haystack + strlen(haystack) - strlen(needle) + 1; while (haystack < hend) { if (*haystack == *needle) { a = haystack; b = needle; for (;;) { - if (*b == 0) return haystack; + if (*b == 0) return (char *)haystack; if (*a++ != *b++) { break; } -- cgit v1.2.1