133965Sjdp/* Portable version of strrchr().
233965Sjdp   This function is in the public domain. */
333965Sjdp
433965Sjdp/*
533965Sjdp
689857Sobrien@deftypefn Supplemental char* strrchr (const char *@var{s}, int @var{c})
733965Sjdp
889857SobrienReturns a pointer to the last occurrence of the character @var{c} in
989857Sobrienthe string @var{s}, or @code{NULL} if not found.  If @var{c} is itself the
1089857Sobriennull character, the results are undefined.
1189857Sobrien
1289857Sobrien@end deftypefn
1389857Sobrien
1433965Sjdp*/
1533965Sjdp
1633965Sjdp#include <ansidecl.h>
1733965Sjdp
1833965Sjdpchar *
19218822Sdimstrrchr (register const char *s, int c)
2033965Sjdp{
2133965Sjdp  char *rtnval = 0;
2233965Sjdp
2333965Sjdp  do {
2433965Sjdp    if (*s == c)
2533965Sjdp      rtnval = (char*) s;
2633965Sjdp  } while (*s++);
2733965Sjdp  return (rtnval);
2833965Sjdp}
29