about summary refs log tree commit diff
path: root/posix/testfnm.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-04-26 23:21:01 +0000
committerUlrich Drepper <drepper@redhat.com>1999-04-26 23:21:01 +0000
commitd8aaef00a787dc18ce87e4c6448615095d511239 (patch)
treec66cfcc06de7fb84023baaa2580d8be6781f77d4 /posix/testfnm.c
parent80127c749ba3b00d0a802170ae5842f599c6c34b (diff)
downloadglibc-d8aaef00a787dc18ce87e4c6448615095d511239.tar.gz
glibc-d8aaef00a787dc18ce87e4c6448615095d511239.tar.xz
glibc-d8aaef00a787dc18ce87e4c6448615095d511239.zip
Update.
1999-04-26  Ulrich Drepper  <drepper@cygnus.com>

	* posix/fnmatch.c (internal_fnmatch): Renamed from fnmatch.  Take
	extra parameter.  Fix several more bugs involving wildcard and
	ranges.
	(fnmatch): New function.  Call internal_fnmatch.

	* posix/testfnm.c: More test cases.
Diffstat (limited to 'posix/testfnm.c')
-rw-r--r--posix/testfnm.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/posix/testfnm.c b/posix/testfnm.c
index b43f9531fb..5a6c7e12ea 100644
--- a/posix/testfnm.c
+++ b/posix/testfnm.c
@@ -15,7 +15,38 @@ struct {
   { "a/b", "[a-z]/[a-z]", 0, 0 },
   { "a/b", "*", FNM_FILE_NAME, FNM_NOMATCH },
   { "a/b", "*[/]b", FNM_FILE_NAME, FNM_NOMATCH },
-  { "a/b", "*[b]", FNM_FILE_NAME, FNM_NOMATCH }
+  { "a/b", "*[b]", FNM_FILE_NAME, FNM_NOMATCH },
+  { "a/b", "[*]/b", 0, FNM_NOMATCH },
+  { "*/b", "[*]/b", 0, 0 },
+  { "a/b", "[?]/b", 0, FNM_NOMATCH },
+  { "?/b", "[?]/b", 0, 0 },
+  { "a/b", "[[a]/b", 0, 0 },
+  { "[/b", "[[a]/b", 0, 0 },
+  { "a/b", "\\*/b", 0, FNM_NOMATCH },
+  { "*/b", "\\*/b", 0, 0 },
+  { "a/b", "\\?/b", 0, FNM_NOMATCH },
+  { "?/b", "\\?/b", 0, 0 },
+  { "[/b", "[/b", 0, FNM_NOMATCH },
+  { "[/b", "\\[/b", 0, 0 },
+  { "aa/b", "??/b", 0, 0 },
+  { "aa/b", "???b", 0, 0 },
+  { "aa/b", "???b", FNM_PATHNAME, FNM_NOMATCH },
+  { ".a/b", "?a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
+  { "a/.b", "a/?b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
+  { ".a/b", "*a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
+  { "a/.b", "a/*b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
+  { ".a/b", "[.]a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
+  { "a/.b", "a/[.]b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
+  { "a/b", "*/?", FNM_PATHNAME|FNM_PERIOD, 0 },
+  { "a/b", "?/*", FNM_PATHNAME|FNM_PERIOD, 0 },
+  { ".a/b", ".*/?", FNM_PATHNAME|FNM_PERIOD, 0 },
+  { "a/.b", "*/.?", FNM_PATHNAME|FNM_PERIOD, 0 },
+  { "a/.b", "*/*", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH },
+  { "a/.b", "*?*/*", FNM_PERIOD, 0 },
+  { "a./b", "*[.]/b", FNM_PATHNAME|FNM_PERIOD, 0 },
+  { "a/b", "*[[:alpha:]]/*[[:alnum:]]", FNM_PATHNAME, 0 },
+  { "a/b", "*[![:digit:]]*/[![:d-d]", FNM_PATHNAME, 0 },
+  { "a/[", "*[![:digit:]]*/[![:d-d]", FNM_PATHNAME, FNM_NOMATCH },
 };
 
 int