X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrstr.c;h=c41e90349ff7b96be0cbcfdf2194649f551048b3;hb=60183d858937837c14bd8a56efc4dde0a36335d6;hp=cdee6211757546f99f4f6613d2ec472f9750c16a;hpb=4838f42df1843ec9f5058d74c8114c1fcb332a89;p=gnulib.git diff --git a/lib/strstr.c b/lib/strstr.c index cdee62117..c41e90349 100644 --- a/lib/strstr.c +++ b/lib/strstr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -24,15 +24,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ * * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ -#include +#if HAVE_CONFIG_H +# include +#endif + +#if defined _LIBC || defined HAVE_STRING_H +# include +#endif #include typedef unsigned chartype; +#undef strstr + char * -strstr (phaystack, pneedle) - const char *phaystack; - const char *pneedle; +strstr (const char *phaystack, const char *pneedle) { register const unsigned char *haystack, *needle; register chartype b, c; @@ -73,7 +79,7 @@ strstr (phaystack, pneedle) a = *++haystack; if (a == '\0') goto ret0; -shloop: } +shloop:; } while (a != b); jin: a = *++haystack; @@ -103,7 +109,7 @@ jin: a = *++haystack; } while (*rhaystack == a); - needle = rneedle; /* took the register-poor aproach */ + needle = rneedle; /* took the register-poor approach */ if (a == '\0') break;