Index: uspace/lib/libc/generic/getopt.c
===================================================================
--- uspace/lib/libc/generic/getopt.c	(revision 92fd52d7f8133beb8043e6bcd17498477fe735ea)
+++ uspace/lib/libc/generic/getopt.c	(revision 7afb4a53710d7b78f26a51c1825abc447de3ea5b)
@@ -242,5 +242,5 @@
 	}
 	if ((optchar = (int)*place++) == (int)':' ||
-	    (oli = strchr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) {
+	    (oli = str_chr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) {
 		/* option letter unknown or ':' */
 		if (!*place)
@@ -378,5 +378,5 @@
 			return -1;
 		}
-		if ((has_equal = strchr(current_argv, '=')) != NULL) {
+		if ((has_equal = str_chr(current_argv, '=')) != NULL) {
 			/* argument found (--option=arg) */
 			current_argv_len = has_equal - current_argv;
Index: uspace/lib/libc/generic/string.c
===================================================================
--- uspace/lib/libc/generic/string.c	(revision 92fd52d7f8133beb8043e6bcd17498477fe735ea)
+++ uspace/lib/libc/generic/string.c	(revision 7afb4a53710d7b78f26a51c1825abc447de3ea5b)
@@ -536,5 +536,4 @@
  *
  * @return Pointer to character in @a str or NULL if not found.
- *
  */
 const char *str_chr(const char *str, wchar_t ch)
@@ -549,4 +548,26 @@
 	
 	return NULL;
+}
+
+/** Find last occurence of character in string.
+ *
+ * @param str String to search.
+ * @param ch  Character to look for.
+ *
+ * @return Pointer to character in @a str or NULL if not found.
+ */
+const char *str_rchr(const char *str, wchar_t ch)
+{
+	wchar_t acc;
+	size_t off = 0;
+	char *res;
+
+	res = NULL;
+	while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) {
+		if (acc == ch)
+			res = (str + off);
+	}
+
+	return res;
 }
 
@@ -626,42 +647,4 @@
 	
 	return (tolower(a[c]) - tolower(b[c]));
-}
-
-/** Return pointer to the first occurence of character c in string.
- *
- * @param str		Scanned string.
- * @param c		Searched character (taken as one byte).
- * @return		Pointer to the matched character or NULL if it is not
- * 			found in given string.
- */
-char *strchr(const char *str, int c)
-{
-	while (*str != '\0') {
-		if (*str == (char) c)
-			return (char *) str;
-		str++;
-	}
-
-	return NULL;
-}
-
-/** Return pointer to the last occurence of character c in string.
- *
- * @param str		Scanned string.
- * @param c		Searched character (taken as one byte).
- * @return		Pointer to the matched character or NULL if it is not
- * 			found in given string.
- */
-char *strrchr(const char *str, int c)
-{
-	char *retval = NULL;
-
-	while (*str != '\0') {
-		if (*str == (char) c)
-			retval = (char *) str;
-		str++;
-	}
-
-	return (char *) retval;
 }
 
@@ -870,9 +853,9 @@
 
 	/* Skip over leading delimiters. */
-	while (*s && (strchr(delim, *s) != NULL)) ++s;
+	while (*s && (str_chr(delim, *s) != NULL)) ++s;
 	start = s;
 
 	/* Skip over token characters. */
-	while (*s && (strchr(delim, *s) == NULL)) ++s;
+	while (*s && (str_chr(delim, *s) == NULL)) ++s;
 	end = s;
 	*next = (*s ? s + 1 : s);
