patch-1.3.95 linux/lib/string.c
Next file: linux/mm/filemap.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index
- Lines: 19
- Date:
Tue Apr 23 13:24:52 1996
- Orig file:
v1.3.94/linux/lib/string.c
- Orig date:
Fri Aug 11 09:26:58 1995
diff -u --recursive --new-file v1.3.94/linux/lib/string.c linux/lib/string.c
@@ -112,6 +112,18 @@
}
#endif
+#ifndef __HAVE_ARCH_STRRCHR
+char * strrchr(const char * s, int c)
+{
+ const char *p = s + strlen(s);
+ do {
+ if (*p == (char)c)
+ return (char *)p;
+ } while (--p >= s);
+ return NULL;
+}
+#endif
+
#ifndef __HAVE_ARCH_STRLEN
size_t strlen(const char * s)
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this