/* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rindex.c 5.8 (Berkeley) 06/23/90"; #endif /* LIBC_SCCS and not lint */ #include #include char * #ifdef STRRCHR strrchr(p, ch) #else rindex(p, ch) #endif register char *p, ch; { register char *save; for (save = NULL;; ++p) { if (*p == ch) save = p; if (!*p) return(save); } /* NOTREACHED */ }