]>
Commit | Line | Data |
---|---|---|
feabcc17 NTND |
1 | #include "cache.h" |
2 | #include "wildmatch.h" | |
3 | ||
4 | int main(int argc, char **argv) | |
5 | { | |
ef49841d NTND |
6 | int i; |
7 | for (i = 2; i < argc; i++) { | |
8 | if (argv[i][0] == '/') | |
9 | die("Forward slash is not allowed at the beginning of the\n" | |
10 | "pattern because Windows does not like it. Use `XXX/' instead."); | |
11 | else if (!strncmp(argv[i], "XXX/", 4)) | |
12 | argv[i] += 3; | |
13 | } | |
feabcc17 | 14 | if (!strcmp(argv[1], "wildmatch")) |
9b3497ca | 15 | return !!wildmatch(argv[3], argv[2], 0, NULL); |
feabcc17 | 16 | else if (!strcmp(argv[1], "iwildmatch")) |
9b3497ca | 17 | return !!wildmatch(argv[3], argv[2], WM_CASEFOLD, NULL); |
feabcc17 NTND |
18 | else if (!strcmp(argv[1], "fnmatch")) |
19 | return !!fnmatch(argv[3], argv[2], FNM_PATHNAME); | |
20 | else | |
21 | return 1; | |
22 | } |