Index: kernel/generic/src/lib/string.c
===================================================================
--- kernel/generic/src/lib/string.c	(revision c2417bcc6cc9caba6dca867e322c9cc5723b35f4)
+++ kernel/generic/src/lib/string.c	(revision f2d2c7ba676ff1a37b6198b134c840dd09e1d11b)
@@ -642,8 +642,10 @@
 	wchar_t acc;
 	size_t off = 0;
+	size_t last = 0;
 	
 	while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) {
 		if (acc == ch)
-			return (str + off);
+			return (str + last);
+		last = off;
 	}
 	
Index: uspace/lib/libc/generic/string.c
===================================================================
--- uspace/lib/libc/generic/string.c	(revision c2417bcc6cc9caba6dca867e322c9cc5723b35f4)
+++ uspace/lib/libc/generic/string.c	(revision f2d2c7ba676ff1a37b6198b134c840dd09e1d11b)
@@ -594,8 +594,10 @@
 	wchar_t acc;
 	size_t off = 0;
+	size_t last = 0;
 	
 	while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) {
 		if (acc == ch)
-			return (str + off);
+			return (str + last);
+		last = off;
 	}
 	
@@ -614,12 +616,13 @@
 	wchar_t acc;
 	size_t off = 0;
-	char *res;
-
-	res = NULL;
+	size_t last = 0;
+	char *res = NULL;
+	
 	while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) {
 		if (acc == ch)
-			res = (str + off);
-	}
-
+			res = (str + last);
+		last = off;
+	}
+	
 	return res;
 }
