diff options
Diffstat (limited to 'libc/misc/fnmatch/fnmatch_old.c')
-rw-r--r-- | libc/misc/fnmatch/fnmatch_old.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libc/misc/fnmatch/fnmatch_old.c b/libc/misc/fnmatch/fnmatch_old.c index 384756569..577e35676 100644 --- a/libc/misc/fnmatch/fnmatch_old.c +++ b/libc/misc/fnmatch/fnmatch_old.c @@ -19,15 +19,13 @@ Cambridge, MA 02139, USA. */ # include <config.h> #endif -/* Enable GNU extensions in fnmatch.h. */ -#ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -#endif - #include <errno.h> #include <fnmatch.h> #include <ctype.h> +libc_hidden_proto(fnmatch) + +libc_hidden_proto(tolower) /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling @@ -50,13 +48,13 @@ Cambridge, MA 02139, USA. */ /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ -int attribute_hidden __fnmatch(const char *pattern, const char *string, int flags) +int fnmatch(const char *pattern, const char *string, int flags) { register const char *p = pattern, *n = string; register char c; /* Note that this evaluates C many times. */ -# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? __tolower (c) : (c)) +# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') { c = FOLD(c); @@ -116,7 +114,7 @@ int attribute_hidden __fnmatch(const char *pattern, const char *string, int flag c1 = FOLD(c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD(*n) == c1) && - __fnmatch(p, n, flags & ~FNM_PERIOD) == 0) + fnmatch(p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } @@ -220,5 +218,5 @@ int attribute_hidden __fnmatch(const char *pattern, const char *string, int flag # undef FOLD } -strong_alias(__fnmatch,fnmatch) +libc_hidden_def(fnmatch) #endif /* _LIBC or not __GNU_LIBRARY__. */ |