Index: uspace/lib/libc/generic/string.c
===================================================================
--- uspace/lib/libc/generic/string.c	(revision 594303bc2c2613b4ab83c29adb62ad2b1a616d92)
+++ uspace/lib/libc/generic/string.c	(revision a1a83e5e5ddb366d3021bdee2baa08d1a60230fc)
@@ -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;
 }
