diff options
author | Jim Meyering <jim@meyering.net> | 2003-09-10 08:36:22 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-09-10 08:36:22 +0000 |
commit | 2ce77368532559c41f09c5cdb1514fde558c9975 (patch) | |
tree | 86e8e396e58a090110250bc7b813dd424aa59d9c /lib/fnmatch.c | |
parent | 2939998ed79430106a54f9e20926026cff650087 (diff) | |
download | coreutils-2ce77368532559c41f09c5cdb1514fde558c9975.tar.xz |
Include fnmatch.h first, to test interface.
Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
(getenv): Remove decl.
(fnmatch): Define using a prototype.
Diffstat (limited to 'lib/fnmatch.c')
-rw-r--r-- | lib/fnmatch.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/lib/fnmatch.c b/lib/fnmatch.c index 73dc0e78e..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,23 +45,14 @@ char *alloca (); # define __builtin_expect(expr, expected) (expr) #endif -#include <assert.h> -#include <errno.h> #include <fnmatch.h> -#include <ctype.h> - -#if HAVE_STRING_H || defined _LIBC -# include <string.h> -#else -# if HAVE_STRINGS_H -# include <strings.h> -# endif -#endif -#if defined STDC_HEADERS || defined _LIBC -# include <stddef.h> -# include <stdlib.h> -#endif +#include <assert.h> +#include <ctype.h> +#include <errno.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> #define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC) @@ -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) |