gcc/libiberty/strrchr.c
Eli Zaretskii e922f9785c libiberty.texi: (Top level): Add syncodeindex pg.
* libiberty.texi: (Top level): Add syncodeindex pg.  Add
@dircategory and @direntry directives.  Add @finalout.
(many nodes): Lose the next,prev,up pointers on the @nide line.
(Using, Supplemental Functions, Replacement Functions): Fix
markup.
(Functions): Move around, to allow makeinfo to build the manual
without next,prev,up pointers in thye node lines.
(Licenses): Fix typos.

* index.c, rindex.c, strchr.c, strerror.c, strrchr.c, strstr.c,
strtol.c, xatexit.c, xexit.c, xmalloc.c: Fix spelling and markup.
* functions.texi: Regenerate.

* copying-lib.texi: Lose the next,prev,up pointers on the @node
line.

From-SVN: r45847
2001-09-27 15:55:37 -04:00

31 lines
551 B
C

/* Portable version of strrchr().
This function is in the public domain. */
/*
@deftypefn Supplemental char* strrchr (const char *@var{s}, int @var{c})
Returns a pointer to the last occurrence of the character @var{c} in
the string @var{s}, or NULL if not found. If @var{c} is itself the
null character, the results are undefined.
@end deftypefn
*/
#include <ansidecl.h>
char *
strrchr (s, c)
register const char *s;
int c;
{
char *rtnval = 0;
do {
if (*s == c)
rtnval = (char*) s;
} while (*s++);
return (rtnval);
}