changeset 6064:199c20f568d7

Fix return value.
author Bruno Haible <bruno@clisp.org>
date Fri, 19 Aug 2005 11:00:51 +0000
parents 12f61def36ee
children 4cb1b544f4cc
files lib/ChangeLog lib/strcasestr.c lib/strstr.c
diffstat 3 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -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
--- a/lib/strcasestr.c
+++ b/lib/strcasestr.c
@@ -88,7 +88,7 @@
 		    {
 		      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;
--- a/lib/strstr.c
+++ b/lib/strstr.c
@@ -71,7 +71,7 @@
 		    {
 		      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;