2 ** Copyright 1998-2002 University of Illinois Board of Trustees
3 ** Copyright 1998-2002 Mark D. Roth
4 ** All rights reserved.
6 ** strrstr.c - strrstr() function for compatibility library
8 ** Mark D. Roth <roth@uiuc.edu>
9 ** Campus Information Technologies and Educational Services
10 ** University of Illinois at Urbana-Champaign
14 #include <sys/types.h>
20 ** find the last occurrance of find in string
23 strrstr(char *string
, char *find
)
25 size_t stringlen
, findlen
;
28 findlen
= strlen(find
);
29 stringlen
= strlen(string
);
30 if (findlen
> stringlen
)
33 for (cp
= string
+ stringlen
- findlen
; cp
>= string
; cp
--)
34 if (strncmp(cp
, find
, findlen
) == 0)