* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* find last occurrence of substring in string
* character*(*) substr, string
* indx = rindex (string, substr)
* indx will be the index of the first character of the last occurence
* of substr in string, or zero if not found.
long rindex_(str
, substr
, slen
, sublen
)
char *str
, *substr
; long slen
, sublen
;
register char *p
= str
+ (slen
- sublen
);
while ( *p1
++ == *p2
++ && --len
> 0) ;
return((long)(++p
- str
));