]> Dogcows Code - chaz/tar/blobdiff - lib/fnmatch.c
(EILSEQ): Include <time.h> and <wchar.h> if <errno.h> does not define
[chaz/tar] / lib / fnmatch.c
index ce55c7ff04b6a6936899e6348c9aecdda72a5b5f..9bff8c220a2f1aaa03f54d7599aa390f3c083eca 100644 (file)
 #include <fnmatch.h>
 #include <ctype.h>
 
+#if defined STDC_HEADERS || !defined isascii
+# define IN_CTYPE_DOMAIN(c) 1
+#else
+# define IN_CTYPE_DOMAIN(c) isascii (c)
+#endif
 
-/* 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
-   and linking in this code is a waste when using the GNU C library
-   (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
-   it is simpler to just do this in the source for each such file.  */
-
-#if defined _LIBC || !defined __GNU_LIBRARY__
-
-
-# if defined STDC_HEADERS || !defined isascii
-#  define IN_CTYPE_DOMAIN(c) 1
-# else
-#  define IN_CTYPE_DOMAIN(c) isascii(c)
-# endif
-
-# define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
+#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
 
 
-# ifndef errno
+#ifndef errno
 extern int errno;
-# endif
+#endif
 
 /* Match STRING against the filename pattern PATTERN, returning zero if
    it matches, nonzero if not.  */
@@ -61,9 +49,9 @@ fnmatch (const char *pattern, const char *string, int flags)
   register char c;
 
 /* Note that this evaluates C many times.  */
-# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER ((unsigned char) (c)) \
-                  ? tolower ((unsigned char) (c)) \
-                  : (c))
+#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER ((unsigned char) (c)) \
+                 ? tolower ((unsigned char) (c)) \
+                 : (c))
 
   while ((c = *p++) != '\0')
     {
@@ -238,7 +226,5 @@ fnmatch (const char *pattern, const char *string, int flags)
 
   return FNM_NOMATCH;
 
-# undef FOLD
+#undef FOLD
 }
-
-#endif /* _LIBC or not __GNU_LIBRARY__.  */
This page took 0.021143 seconds and 4 git commands to generate.