summaryrefslogtreecommitdiff
path: root/dviware/beebe/src/strrchr.h
blob: 560c8595bdf034d8c64651acef5a15862ee3e241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* -*-C-*- strrchr.h */
/*-->strrchr*/
/**********************************************************************/
/****************************** strrchr *******************************/
/**********************************************************************/

#if    (KCC_20 | IBM_PC_MICROSOFT | OS_VAXVMS)
#else
char*
strrchr(s,c)	/* return address of last occurrence of c in s[], */
		/* or (char*)NULL if not found.  c may be NUL; */
		/* terminator of s[] is included in search. */
register char *s;
register char c;
{
    register char *t;

    t = (char *)NULL;
    for (;;)		/* loop forever */
    {
	if (*s == c)
	    t = s;	/* remember last match position */
	if (!*s)
	    break;	/* exit when NULL reached */
	++s;		/* advance to next character */
    }
    return (t);
}
#endif