summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/fnmatch_loop.c5
-rw-r--r--posix/tst-fnmatch.input27
2 files changed, 28 insertions, 4 deletions
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
index 0c14d45db7..fb56bd426b 100644
--- a/posix/fnmatch_loop.c
+++ b/posix/fnmatch_loop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2003
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2003,2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -242,8 +242,7 @@ FCT (pattern, string, string_end, no_leading_period, flags)
c = FOLD ((UCHAR) *p);
++p;
- if (c == fn)
- goto matched;
+ goto normal_bracket;
}
else if (c == L('[') && *p == L(':'))
{
diff --git a/posix/tst-fnmatch.input b/posix/tst-fnmatch.input
index faea8e2f9b..9061d19945 100644
--- a/posix/tst-fnmatch.input
+++ b/posix/tst-fnmatch.input
@@ -1,5 +1,5 @@
# Tests for fnmatch.
-# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributes by Ulrich Drepper <drepper@redhat.com>.
#
@@ -389,6 +389,31 @@ C "az" "[-a]z" 0
C "bz" "[-ab]z" 0
C "cz" "[-ab]z" NOMATCH
C "-z" "[-ab]z" 0
+C "\\" "[\\\\-a]" 0
+C "_" "[\\\\-a]" 0
+C "a" "[\\\\-a]" 0
+C "-" "[\\\\-a]" NOMATCH
+C "\\" "[\\]-a]" NOMATCH
+C "_" "[\\]-a]" 0
+C "a" "[\\]-a]" 0
+C "]" "[\\]-a]" 0
+C "-" "[\\]-a]" NOMATCH
+C "\\" "[!\\\\-a]" NOMATCH
+C "_" "[!\\\\-a]" NOMATCH
+C "a" "[!\\\\-a]" NOMATCH
+C "-" "[!\\\\-a]" 0
+C "!" "[\\!-]" 0
+C "-" "[\\!-]" 0
+C "\\" "[\\!-]" NOMATCH
+C "Z" "[Z-\\\\]" 0
+C "[" "[Z-\\\\]" 0
+C "\\" "[Z-\\\\]" 0
+C "-" "[Z-\\\\]" NOMATCH
+C "Z" "[Z-\\]]" 0
+C "[" "[Z-\\]]" 0
+C "\\" "[Z-\\]]" 0
+C "]" "[Z-\\]]" 0
+C "-" "[Z-\\]]" NOMATCH
# Following are tests outside the scope of IEEE 2003.2 since they are using
# locales other than the C locale. The main focus of the tests is on the