diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-04-26 23:21:01 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-04-26 23:21:01 +0000 |
commit | d8aaef00a787dc18ce87e4c6448615095d511239 (patch) | |
tree | c66cfcc06de7fb84023baaa2580d8be6781f77d4 /posix/testfnm.c | |
parent | 80127c749ba3b00d0a802170ae5842f599c6c34b (diff) | |
download | glibc-d8aaef00a787dc18ce87e4c6448615095d511239.zip glibc-d8aaef00a787dc18ce87e4c6448615095d511239.tar.gz glibc-d8aaef00a787dc18ce87e4c6448615095d511239.tar.bz2 |
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.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/posix/testfnm.c b/posix/testfnm.c index b43f953..5a6c7e1 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 |