aboutsummaryrefslogtreecommitdiff
path: root/posix/fnmatch.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-04-01 19:44:33 +0000
committerUlrich Drepper <drepper@redhat.com>2007-04-01 19:44:33 +0000
commit9700b0390e40c7ffaed2a74ae3285edfe6080bd3 (patch)
tree51b814dcdce050fc10f562542b36bd5956ed6fce /posix/fnmatch.c
parented09a96ca8b1b9c830343b977f317ca11d691a27 (diff)
downloadglibc-9700b0390e40c7ffaed2a74ae3285edfe6080bd3.tar
glibc-9700b0390e40c7ffaed2a74ae3285edfe6080bd3.tar.gz
glibc-9700b0390e40c7ffaed2a74ae3285edfe6080bd3.tar.bz2
glibc-9700b0390e40c7ffaed2a74ae3285edfe6080bd3.zip
* posix/fnmatch.c (STRUCT): Define.
(fnmatch): Pass NULL as last argument to internal_fn{,w}match. * posix/fnmatch_loop.c (struct STRUCT): New type. (FCT): Add ends argument. If ends != NULL and normal * is seen in the pattern, store current pattern and string pointers and return. Adjust recursive calls. (EXT): Adjust FCT callers. (STRUCT): Undef at the end of the file. * posix/Makefile (tests): Add tst-fnmatch2. * posix/tst-fnmatch2.c: New test.
Diffstat (limited to 'posix/fnmatch.c')
-rw-r--r--posix/fnmatch.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/posix/fnmatch.c b/posix/fnmatch.c
index 3fa7c322d1..c6cdb88772 100644
--- a/posix/fnmatch.c
+++ b/posix/fnmatch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -209,6 +209,7 @@ __wcschrnul (s, c)
# define FCT internal_fnmatch
# define EXT ext_match
# define END end_pattern
+# define STRUCT fnmatch_struct
# define L(CS) CS
# ifdef _LIBC
# define BTOWC(C) __btowc (C)
@@ -235,7 +236,8 @@ __wcschrnul (s, c)
# define INT wint_t
# define FCT internal_fnwmatch
# define EXT ext_wmatch
-# define END end_wpattern
+# define END end_wpattern
+# define STRUCT fnwmatch_struct
# define L(CS) L##CS
# define BTOWC(C) (C)
# define STRLEN(S) __wcslen (S)
@@ -397,12 +399,12 @@ fnmatch (pattern, string, flags)
}
return internal_fnwmatch (wpattern, wstring, wstring + n,
- flags & FNM_PERIOD, flags);
+ flags & FNM_PERIOD, flags, NULL);
}
# endif /* mbstate_t and mbsrtowcs or _LIBC. */
return internal_fnmatch (pattern, string, string + strlen (string),
- flags & FNM_PERIOD, flags);
+ flags & FNM_PERIOD, flags, NULL);
}
# ifdef _LIBC