|
Last change
on this file since 3176 was 610, checked in by bird, 22 years ago |
|
This commit was generated by cvs2svn to compensate for changes in r609,
which included commits to RCS files with non-trunk default branches.
|
-
Property cvs2svn:cvs-rev
set to
1.1.1.2
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
558 bytes
|
| Line | |
|---|
| 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 (s, c)
|
|---|
| 20 | register const char *s;
|
|---|
| 21 | int c;
|
|---|
| 22 | {
|
|---|
| 23 | char *rtnval = 0;
|
|---|
| 24 |
|
|---|
| 25 | do {
|
|---|
| 26 | if (*s == c)
|
|---|
| 27 | rtnval = (char*) s;
|
|---|
| 28 | } while (*s++);
|
|---|
| 29 | return (rtnval);
|
|---|
| 30 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.