X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffnmatch.c;h=48bc8b5d2a0b9e6c1bcd730cbdf6997605d93e15;hb=29dd8b5548ce047ce51ff9a73d6c4b50c9886771;hp=c5a4e4071368abcc3161c8b0e30fb28aa5e30d1c;hpb=3585608d42307ab95969d64555a9c2f92fd90caa;p=gnulib.git diff --git a/lib/fnmatch.c b/lib/fnmatch.c index c5a4e4071..48bc8b5d2 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006 +/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H +#ifndef _LIBC # include #endif @@ -40,15 +40,14 @@ #include #define WIDE_CHAR_SUPPORT \ - (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC \ + (HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \ && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY)) /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ #if defined _LIBC || WIDE_CHAR_SUPPORT -/* Solaris 2.5 has a bug: must be included before . */ -# include # include +# include #endif /* We need some of the locale data (the collation sequence information) @@ -86,33 +85,9 @@ extern int fnmatch (const char *pattern, const char *string, int flags); #if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU -# if defined STDC_HEADERS || !defined isascii -# define ISASCII(c) 1 -# else -# define ISASCII(c) isascii(c) -# endif - -# ifdef isblank -# define ISBLANK(c) (ISASCII (c) && isblank (c)) -# else -# define ISBLANK(c) ((c) == ' ' || (c) == '\t') +# if ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK)) +# define isblank(c) ((c) == ' ' || (c) == '\t') # endif -# ifdef isgraph -# define ISGRAPH(c) (ISASCII (c) && isgraph (c)) -# else -# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) -# endif - -# define ISPRINT(c) (ISASCII (c) && isprint (c)) -# define ISDIGIT(c) (ISASCII (c) && isdigit (c)) -# define ISALNUM(c) (ISASCII (c) && isalnum (c)) -# define ISALPHA(c) (ISASCII (c) && isalpha (c)) -# define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) -# define ISLOWER(c) (ISASCII (c) && islower (c)) -# define ISPUNCT(c) (ISASCII (c) && ispunct (c)) -# define ISSPACE(c) (ISASCII (c) && isspace (c)) -# define ISUPPER(c) (ISASCII (c) && isupper (c)) -# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) # define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) @@ -169,11 +144,7 @@ static int posixly_correct; # endif /* Note that this evaluates C many times. */ -# ifdef _LIBC -# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c)) -# else -# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) -# endif +# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c)) # define CHAR char # define UCHAR unsigned char # define INT int