Yesterday's changes.
[gnulib.git] / lib / strstr.c
index 5bd7cb4..e94cef7 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
 
 /* Specification.  */
 #include "strstr.h"
 
+#include <stddef.h>  /* for NULL */
+
 #if HAVE_MBRTOWC
 # include "mbuiter.h"
 #endif
@@ -71,7 +73,7 @@ strstr (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;