home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / libc / gen / rindex.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-01-10  |  248 b   |  21 lines

  1. /*
  2.  * Return the ptr in sp at which the character c last
  3.  * appears; NULL if not found
  4. */
  5.  
  6. #define NULL 0
  7.  
  8. char *
  9. rindex(sp, c)
  10. register char *sp, c;
  11. {
  12.     register char *r;
  13.  
  14.     r = NULL;
  15.     do {
  16.         if (*sp == c)
  17.             r = sp;
  18.     } while (*sp++);
  19.     return(r);
  20. }
  21.