Fix return value.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Aug 2005 11:00:51 +0000 (11:00 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Aug 2005 11:00:51 +0000 (11:00 +0000)
lib/ChangeLog
lib/strcasestr.c
lib/strstr.c

index 60a56d60420495f92a13b267523eda10456c801e..3f6d105c9eb162ceeb6f7a2e8495cca5caf34c62 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-18  Bruno Haible  <bruno@clisp.org>
+
+       * strstr.c (strstr): Fix return value in multibyte case.
+       * strcasestr.c (strcasestr): Likewise.
+
 2005-08-17  Jim Meyering  <jim@meyering.net>
 
        Make the %s format (seconds since the epoch) work for a negative
index de4cf45fa5902b7178a79c87d778390dc3cd273c..5a0fc426ec001c69275a39780505c2350c71d2e0 100644 (file)
@@ -88,7 +88,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;
index 5bd7cb4658890734141a59c4e4f791f743b52876..3faae014079eb81ac2ad7674f440a46e65d88c29 100644 (file)
@@ -71,7 +71,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;