1 /* 2 ** Copyright 2001, Manuel J. Petit. All rights reserved. 3 ** Distributed under the terms of the NewOS License. 4 */ 5 6 #include <sys/types.h> 7 #include <string.h> 8 9 10 char * 11 strrchr(char const *s, int c) 12 { 13 char const *last = c ? 0 : s; 14 15 16 while (*s) { 17 if (*s == c) 18 last = s; 19 20 s += 1; 21 } 22 23 return (char *)last; 24 } 25 26 27 char * 28 rindex(char const *s, int c) 29 { 30 return strrchr(s, c); 31 } 32 33