/************************************************************* * File: lib/rindex.c * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 970304 Start of revision history */ #include "string.h" /** char *rindex(s,c) returns ptr to c in s, starting at end of s, else 0 */ char *rindex(s,c) char *s; int c; { char *p; if (s == 0) return(0); for (p=s;*p;p++) ; for (;p >= s;p--) { if (*p == c) return(p); } return(0); }