util.c
/* return ptr to little string in big string, NULL if not found */
/* This routine was donated by Corey Satten. */
return ptr to little string in big string, NULL if not found
This routine was donated by Corey Satten.
return ptr to little string in big string NULL if not found This routine was donated by Corey Satten .
char *
Perl_instr(register const char *big, register const char *little)
{
    register I32 first;
    PERL_ARGS_ASSERT_INSTR;
    if (!little)
	return (char*)big;
    first = *little++;
    if (!first)
	return (char*)big;
    while (*big) {
	register const char *s, *x;
	if (*big++ != first)
	    continue;
	for (x=big,s=little; *s;  ) {
	    if (!*x)
		return NULL;
	    if (*s != *x)
		break;
	    else {
		s++;
		x++;
	    }
	}
	if (!*s)
	    return (char*)(big-1);
    }
    return NULL;
}
char * Perl_instr ( register const char * big , register const char * little ) { register I32 first ; PERL_ARGS_ASSERT_INSTR ; if ( ! little ) return ( char * ) big ; first = * little ++ ; if ( ! first ) return ( char * ) big ; while ( * big ) { register const char * s , * x ; if ( * big ++ != first ) continue ; for ( x = big , s = little ; * s ; ) { if ( ! * x ) return NULL ; if ( * s != * x ) break ; else { s ++ ; x ++ ; } } if ( ! * s ) return ( char * ) ( big - 1 ) ; } return NULL ; }
return ptr to little string in big string, NULL if not found
This routine was donated by Corey Satten.
return ptr to little string in big string NULL if not found This routine was donated by Corey Satten .
/**/