X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xgamelist.c;h=258eb39fc00e2fa3e1b331dcbcdb15c82e4f699d;hb=2b546bdf3126bdacdeb9d40f34cfbbc1cb163db5;hp=f92a47391086774e4a36063aad935cdb150bea67;hpb=08b22226292c25c7eba27a1ed4e7fb2edf580ec9;p=xboard.git diff --git a/xgamelist.c b/xgamelist.c index f92a473..258eb39 100644 --- a/xgamelist.c +++ b/xgamelist.c @@ -123,62 +123,6 @@ static Arg layoutArgs[] = { { XtNdefaultDistance, 0 } }; -/* [AS] Wildcard pattern matching */ -static Boolean HasPattern( const char * text, const char * pattern ) -{ - while( *pattern != '\0' ) { - if( *pattern == '*' ) { - while( *pattern == '*' ) { - pattern++; - } - - if( *pattern == '\0' ) { - return TRUE; - } - - while( *text != '\0' ) { - if( HasPattern( text, pattern ) ) { - return TRUE; - } - text++; - } - } - else if( (*pattern == *text) || ((*pattern == '?') && (*text != '\0')) ) { - pattern++; - text++; - continue; - } - - return FALSE; - } - - return TRUE; -} - -static Boolean SearchPattern( const char * text, const char * pattern ) -{ - Boolean result = TRUE; - - if( pattern != NULL && *pattern != '\0' ) { - if( *pattern == '*' ) { - result = HasPattern( text, pattern ); - } - else { - result = FALSE; - - while( *text != '\0' ) { - if( HasPattern( text, pattern ) ) { - result = TRUE; - break; - } - text++; - } - } - } - - return result; -} - Widget GameListCreate(name, callback, client_data) char *name;