Mercurial > hg > CbC > CbC_gcc
comparison libiberty/strrchr.c @ 0:a06113de4d67
first commit
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2009 14:47:48 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 /* Portable version of strrchr(). | |
2 This function is in the public domain. */ | |
3 | |
4 /* | |
5 | |
6 @deftypefn Supplemental char* strrchr (const char *@var{s}, int @var{c}) | |
7 | |
8 Returns a pointer to the last occurrence of the character @var{c} in | |
9 the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the | |
10 null character, the results are undefined. | |
11 | |
12 @end deftypefn | |
13 | |
14 */ | |
15 | |
16 #include <ansidecl.h> | |
17 | |
18 char * | |
19 strrchr (register const char *s, int c) | |
20 { | |
21 char *rtnval = 0; | |
22 | |
23 do { | |
24 if (*s == c) | |
25 rtnval = (char*) s; | |
26 } while (*s++); | |
27 return (rtnval); | |
28 } |