# HG changeset patch # User enz # Date 988740448 -3600 # Node ID 19e3aa71719608527a285512833ad6407b1cbe06 # Parent 0ce333d046b91beeb147fa4c076dd7805027145f [svn] do not search all groups if group does not exist and contains no wildcards diff -r 0ce333d046b9 -r 19e3aa717196 src/server.c --- a/src/server.c Tue Mar 13 11:46:03 2001 +0000 +++ b/src/server.c Tue May 01 19:07:28 2001 +0100 @@ -1,7 +1,7 @@ /* server.c - $Id: server.c 260 2001-02-25 23:29:50Z bears $ + $Id: server.c 270 2001-05-01 18:07:28Z enz $ */ #if HAVE_CONFIG_H @@ -667,6 +667,12 @@ return TRUE; } +static Bool +containsWildcards( const char *pattern ) +{ + return ( strpbrk( pattern, "?*[\\" ) == NULL ? FALSE : TRUE ); +} + static void printGroups( const char *pat, void (*printProc)( Str, const char* ) ) { @@ -674,12 +680,7 @@ const char *g; putStat( STAT_GRPS_FOLLOW, "Groups" ); - if ( Grp_exists( pat ) ) - { - (*printProc)( line, pat ); - putTxtLn( line ); - } - else + if ( containsWildcards( pat ) ) { if ( Grp_firstGrp( &g ) ) do @@ -690,6 +691,11 @@ } while ( Grp_nextGrp( &g ) ); } + else if ( Grp_exists( pat ) ) + { + (*printProc)( line, pat ); + putTxtLn( line ); + } putEndOfTxt(); }