projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(jm_ICONV): Recommend GNU libiconv.
[gnulib.git]
/
lib
/
strstr.c
diff --git
a/lib/strstr.c
b/lib/strstr.c
index
cdee621
..
c41e903
100644
(file)
--- 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
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 */
*
* Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
-#include <string.h>
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined _LIBC || defined HAVE_STRING_H
+# include <string.h>
+#endif
#include <sys/types.h>
typedef unsigned chartype;
#include <sys/types.h>
typedef unsigned chartype;
+#undef strstr
+
char *
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;
{
register const unsigned char *haystack, *needle;
register chartype b, c;
@@
-73,7
+79,7
@@
strstr (phaystack, pneedle)
a = *++haystack;
if (a == '\0')
goto ret0;
a = *++haystack;
if (a == '\0')
goto ret0;
-shloop:
}
+shloop:
;
}
while (a != b);
jin: a = *++haystack;
while (a != b);
jin: a = *++haystack;
@@
-103,7
+109,7
@@
jin: a = *++haystack;
}
while (*rhaystack == a);
}
while (*rhaystack == a);
- needle = rneedle; /* took the register-poor aproach */
+ needle = rneedle; /* took the register-poor ap
p
roach */
if (a == '\0')
break;
if (a == '\0')
break;