00001 /* Portable version of strrchr(). 00002 This function is in the public domain. */ 00003 00004 /* 00005 00006 @deftypefn Supplemental char* strrchr (const char *@var{s}, int @var{c}) 00007 00008 Returns a pointer to the last occurrence of the character @var{c} in 00009 the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the 00010 null character, the results are undefined. 00011 00012 @end deftypefn 00013 00014 */ 00015 00016 #include <ansidecl.h> 00017 00018 char * 00019 strrchr (s, c) 00020 register const char *s; 00021 int c; 00022 { 00023 char *rtnval = 0; 00024 00025 do { 00026 if (*s == c) 00027 rtnval = (char*) s; 00028 } while (*s++); 00029 return (rtnval); 00030 }
1.5.6