strrindex.c 365 B

1234567891011121314151617181920
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. #include "ack_string.h"
  7. char *
  8. strrindex(str, chr)
  9. register char *str;
  10. int chr;
  11. {
  12. register char *retptr = 0;
  13. while (*str)
  14. if (*str++ == chr)
  15. retptr = &str[-1];
  16. return retptr;
  17. }