static BOOL MatchMask( char* name, char* mask)
{
	if ( !mask || !name )
		return mask == name;

	if ( *mask != '|' ) 
		return WildComparei( name, mask );
	
	char* temp = NEWSTR_ALLOCA(mask);
	for ( int e=1; mask[e] != '\0'; e++ ) {
		int s = e;
		while ( mask[e] != '\0' && mask[e] != '|')
			e++;

		memcpy( temp, mask+s, e-s );
		temp[e-s] = '\0';
		if ( WildComparei( name, temp ))
			return TRUE;

		if ( mask[e] == 0 )
			return FALSE;
	}

	return FALSE;
}
static BOOL MatchMask(const TCHAR *name, const TCHAR *mask)
{
	if (!mask || !name)
		return mask == name;

	if (*mask != '|')
		return WildComparei(name, mask);

	TCHAR *temp = NEWTSTR_ALLOCA(mask);
	for (int e=1; mask[e] != '\0'; e++) {
		int s = e;
		while (mask[e] != '\0' && mask[e] != '|')
			e++;

		temp[e]= 0;
		if (WildComparei(name, temp+s))
			return TRUE;

		if (mask[e] == 0)
			return FALSE;
	}

	return FALSE;
}