util.c
/* reverse of the above--find last substring */
reverse of the above--find last substring
reverse of the above -- find last substring
char *
Perl_rninstr(register const char *big, const char *bigend, const char *little, const char *lend)
{
    register const char *bigbeg;
    register const I32 first = *little;
    register const char * const littleend = lend;
    PERL_ARGS_ASSERT_RNINSTR;
    if (little >= littleend)
	return (char*)bigend;
    bigbeg = big;
    big = bigend - (littleend - little++);
    while (big >= bigbeg) {
	register const char *s, *x;
	if (*big-- != first)
	    continue;
	for (x=big+2,s=little; s < littleend;  ) {
	    if (*s != *x)
		break;
	    else {
		x++;
		s++;
	    }
	}
	if (s >= littleend)
	    return (char*)(big+1);
    }
    return NULL;
}
char * Perl_rninstr ( register const char * big , const char * bigend , const char * little , const char * lend ) { register const char * bigbeg ; register const I32 first = * little ; register const char * const littleend = lend ; PERL_ARGS_ASSERT_RNINSTR ; if ( little >= littleend ) return ( char * ) bigend ; bigbeg = big ; big = bigend - ( littleend - little ++ ) ; while ( big >= bigbeg ) { register const char * s , * x ; if ( * big -- != first ) continue ; for ( x = big + 2 , s = little ; s < littleend ; ) { if ( * s != * x ) break ; else { x ++ ; s ++ ; } } if ( s >= littleend ) return ( char * ) ( big + 1 ) ; } return NULL ; }
reverse of the above--find last substring
reverse of the above -- find last substring
/**/