So.... I have the strings
Code:
new string[] = "pp_area_ent";
new match[] = "pp_%s_ent";
I need a function to behave like equali and so I have:
Code:
SmartEquali( const string[], match[], strcomp_len )
{
new wildcard = containi( match, "%s" );
// if no wildcard or wildcard is at end of string
if( wildcard == -1 || (wildcard >= strcomp_len && strcomp_len > 0) ){
if( strcomp_len != -1 ){
if( equali( string, match, strcomp_len ) )
return true;
}
else{
if( containi( string, match )!=-1 )
return true;
}
return false;
}
else{
new match_start[32], match_end[32];
copy( match_start, 31, match );
match_start[wildcard] = 0;
copy( match_end, 31, match[wildcard+2] );
return (SmartEquali( string, match_start, wildcard ) && SmartEquali( string, match_end, -1 ))
}
return false;
}
Anyone see problems with it? (Haven't been able to test it)