X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffnmatch.c;h=fe4e502a512b7b740f799bbf446d0d55932c9234;hb=b3b353659ac863c94e9705047710a99fa58fe0b1;hp=452edc063f235ecf37b35c9e5d5bd96d339cdcb6;hpb=db9171009a0f745a378d90c9932bedab4906bd15;p=gnulib.git diff --git a/lib/fnmatch.c b/lib/fnmatch.c index 452edc063..fe4e502a5 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -1,5 +1,5 @@ /* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,27 +45,20 @@ char *alloca (); # define __builtin_expect(expr, expected) (expr) #endif -#include -#include #include -#include -#if HAVE_STRING_H || defined _LIBC -# include -#else -# if HAVE_STRINGS_H -# include -# endif -#endif +#include +#include +#include +#include +#include +#include -#if defined STDC_HEADERS || defined _LIBC -# include -# include -#endif +#define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC) /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ -#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) +#if defined _LIBC || WIDE_CHAR_SUPPORT /* Solaris 2.5 has a bug: must be included before . */ # include # include @@ -103,7 +96,6 @@ extern int fnmatch (const char *pattern, const char *string, int flags); #if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU -# undef ISASCII /* defined in Solaris5.6's /usr/include/sys/euc.h */ # if defined STDC_HEADERS || !defined isascii # define ISASCII(c) 1 # else @@ -121,7 +113,6 @@ extern int fnmatch (const char *pattern, const char *string, int flags); # define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) # endif -# undef ISPRINT /* defined in Solaris5.6's /usr/include/sys/euc.h */ # define ISPRINT(c) (ISASCII (c) && isprint (c)) # define ISDIGIT(c) (ISASCII (c) && isdigit (c)) # define ISALNUM(c) (ISASCII (c) && isalnum (c)) @@ -135,7 +126,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags); # define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) -# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) +# if defined _LIBC || WIDE_CHAR_SUPPORT /* The GNU C library provides support for user-defined character classes and the functions from ISO C amendement 1. */ # ifdef CHARCLASS_NAME_MAX @@ -178,10 +169,6 @@ extern int fnmatch (const char *pattern, const char *string, int flags); /* Avoid depending on library functions or files whose names are inconsistent. */ -# if !defined _LIBC && !defined getenv && !HAVE_DECL_GETENV -extern char *getenv (); -# endif - # ifndef errno extern int errno; # endif @@ -328,10 +315,7 @@ is_char_class (const wchar_t *wcs) int -fnmatch (pattern, string, flags) - const char *pattern; - const char *string; - int flags; +fnmatch (const char *pattern, const char *string, int flags) { # if HANDLE_MULTIBYTE if (__builtin_expect (MB_CUR_MAX, 1) != 1)