X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Flibc.c;h=ef944267b102b135056a4c1fe9fa33b858f4b315;hb=4ebe00546574e97c5316881881f7f2562deea74b;hp=08ebc623d0b81706342a789248d4fc2c2e9f4c25;hpb=bf62604f78c2d8bc88cac3664e15ed02c6e6d581;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/libc.c b/KernelLand/Kernel/libc.c index 08ebc623..ef944267 100644 --- a/KernelLand/Kernel/libc.c +++ b/KernelLand/Kernel/libc.c @@ -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