* m4/fnmatch.m4: Use gnulib's fnmatch if the system fnmatch
doesn't allow the literal matching of a lone "[" (which is
required by POSIX).
* tests/test-fnmatch.c (main): Check that "[/b" matches itself.
+2011-05-12 James Youngman <jay@gnu.org>
+
+ Add a test for glibc's Bugzilla bug #12378.
+ * m4/fnmatch.m4: Use gnulib's fnmatch if the system fnmatch
+ doesn't allow the literal matching of a lone "[" (which is
+ required by POSIX).
+ * tests/test-fnmatch.c (main): Check that "[/b" matches itself.
+
2011-05-11 Ulrich Drepper <drepper@gmail.com>
Sync glibc change fixing Bugzilla bug #12378.
return 1;
if (!y ("a*", "abc", 0))
return 1;
+ if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
+ return 1;
if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
return 2;
if (!y ("a\\\\bc", "abc", 0))
ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", 0) == 0);
ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", FNM_NOESCAPE) == FNM_NOMATCH);
+ /* Verify that an unmatched [ is treated as a literal, as POSIX
+ requires. This test ensures that glibc Bugzilla bug #12378 stays
+ fixed.
+ */
+ ASSERT (res = fnmatch ("[/b", "[/b", 0) == 0);
+
return 0;
}