3 * r1bindex.c -- Given a string and a character, return a pointer
4 * -- to the right of the rightmost occurrence of the
5 * -- character. If the character doesn't occur, the
6 * -- pointer will be at the beginning of the string.
8 * This code is Copyright (c) 2002, by the authors of nmh. See the
9 * COPYRIGHT file in the root directory of the nmh distribution for
10 * complete copyright information.
17 r1bindex(char *str, int chr)
21 /* find null at the end of the string */
22 for (cp = str; *cp; cp++)
25 /* backup to the rightmost character */
28 /* now search for the rightmost occurrence of the character */
29 while (cp >= str && *cp != chr)
32 /* now move one to the right */