(__attribute): Define to nothing for GCC 2.
[gnulib.git] / lib / strcasestr.c
index de4cf45..64291a1 100644 (file)
@@ -24,6 +24,7 @@
 #include "strcasestr.h"
 
 #include <ctype.h>
+#include <stddef.h>  /* for NULL */
 
 #if HAVE_MBRTOWC
 # include "mbuiter.h"
@@ -88,7 +89,7 @@ strcasestr (const char *haystack, const char *needle)
                    {
                      if (!mbui_avail (rneedle))
                        /* Found a match.  */
-                       return (char *) haystack;
+                       return (char *) mbui_cur_ptr (iter_haystack);
                      if (!mbui_avail (rhaystack))
                        /* No match.  */
                        return NULL;