diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-20 02:22:50 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-20 02:22:50 +0000 |
commit | f8f4a09e312afc9816e282c83449615ed146ea50 (patch) | |
tree | 35a33ab64f63da4a5d225cc309b8cee56b2e45cb /missing/strstr.c | |
parent | 2dd8bc29f1852c59d42731627341d209b420b6ab (diff) | |
download | ruby-f8f4a09e312afc9816e282c83449615ed146ea50.tar.gz ruby-f8f4a09e312afc9816e282c83449615ed146ea50.tar.xz ruby-f8f4a09e312afc9816e282c83449615ed146ea50.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@9427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing/strstr.c')
-rw-r--r-- | missing/strstr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/missing/strstr.c b/missing/strstr.c index 1673518f0..2e9c282fb 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; } |