X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fr1bindex.c;fp=sbr%2Fr1bindex.c;h=0000000000000000000000000000000000000000;hb=240013872c392fe644bd4f79382d9f5314b4ea60;hp=49ac0f578e310cc379ce862f77139dd319bf648f;hpb=c20b4fa14515c7ab388ce35411d89a7a92300711;p=mmh diff --git a/sbr/r1bindex.c b/sbr/r1bindex.c deleted file mode 100644 index 49ac0f5..0000000 --- a/sbr/r1bindex.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -** r1bindex.c -- Given a string and a character, return a pointer -** -- to the right of the rightmost occurrence of the -** -- character. If the character doesn't occur, the -** -- pointer will be at the beginning of the string. -** -** This code is Copyright (c) 2002, by the authors of nmh. See the -** COPYRIGHT file in the root directory of the nmh distribution for -** complete copyright information. -*/ - -#include - - -char * -r1bindex(char *str, int chr) -{ - char *cp; - - /* find null at the end of the string */ - for (cp = str; *cp; cp++) - continue; - - /* backup to the rightmost character */ - --cp; - - /* now search for the rightmost occurrence of the character */ - while (cp >= str && *cp != chr) - --cp; - - /* now move one to the right */ - return (++cp); -}