From 90890ef9fc2e0e1de389f6bc8137f7db7c8f9621 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Mar 2001 06:44:49 +0000 Subject: added -E option (for exit on errors) forced exclusion of filenames containing only '.' as NT rejects those (This used to be commit a83ff172f271aa74148016f0e2ac62c868c140fb) --- source3/utils/masktest.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/masktest.c b/source3/utils/masktest.c index 8ee590d077..a654b5bfd1 100644 --- a/source3/utils/masktest.c +++ b/source3/utils/masktest.c @@ -33,6 +33,7 @@ static BOOL old_list = False; static char *maskchars = "<>\"?*abc."; static char *filechars = "abcdefghijklm."; static int verbose; +static int die_on_error; /* a test fn for LANMAN mask support */ int ms_fnmatch_lanman_core(char *pattern, char *string) @@ -327,7 +328,7 @@ static void testpair(struct cli_state *cli, char *mask, char *file) if (showall || strcmp(res1, res2)) { DEBUG(0,("%s %s %d mask=[%s] file=[%s] rfile=[%s/%s]\n", res1, res2, count, mask, file, long_name, short_name)); - /* exit(1); */ + if (die_on_error) exit(1); } cli_unlink(cli, file); @@ -380,6 +381,8 @@ static void test_mask(int argc, char *argv[], strcmp(file+l,"..") == 0 || strcmp(mask+l,"..") == 0) continue; + if (strspn(file+l, ".") == strlen(file+l)) continue; + testpair(cli, mask, file); } @@ -454,8 +457,11 @@ static void usage(void) seed = time(NULL); - while ((opt = getopt(argc, argv, "U:s:hm:f:aoW:M:v")) != EOF) { + while ((opt = getopt(argc, argv, "U:s:hm:f:aoW:M:vE")) != EOF) { switch (opt) { + case 'E': + die_on_error = 1; + break; case 'v': verbose++; break; -- cgit