This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/fnmatch.c

22 lines
469 B
C

#include <stdio.h>
#include <fnmatch.h>
#include <stdlib.h>
#include <limits.h>
int main( int argc, char **argv )
{
int i;
char buffer[PATH_MAX+1];
while( gets( buffer ) ) {
for( i = 1; i < argc; i++ ) {
if( fnmatch( argv[i], buffer, 0 ) == 0 ) {
printf( "'%s' matches pattern '%s'\n",
buffer, argv[i] );
break;
}
}
}
return( EXIT_SUCCESS );
}