Kernel - VFS API Update - ReadDir caller provided buffer
[tpg/acess2.git] / KernelLand / Kernel / libc.c
index 08ebc62..ef94426 100644 (file)
@@ -49,6 +49,7 @@ EXPORT(tolower);
 
 EXPORT(strucmp);
 EXPORT(strchr);
+EXPORT(strrchr);
 EXPORT(strpos);
 EXPORT(strlen);
 EXPORT(strcpy);
@@ -529,6 +530,15 @@ char *strchr(const char *__s, int __c)
        return NULL;
 }
 
+char *strrchr(const char *__s, int __c)
+{
+       size_t ofs = strlen(__s);
+       while(--ofs && __s[ofs] != __c);
+       if( __s[ofs] == __c )
+               return (char*)__s + ofs;
+       return NULL;
+}
+
 /**
  * \fn int strpos(const char *Str, char Ch)
  * \brief Search a string for an ascii character

UCC git Repository :: git.ucc.asn.au