my system the LIBC tests meant it never compiled and we used the
broken system one.
hacked it so it does compile
- if (fnmatch(pattern, name, ex->fnmatch_flags) == 0)
+ if (fnmatch(pattern, name, ex->fnmatch_flags) == 0) {
} else {
int l1 = strlen(name);
int l2 = strlen(pattern);
if (l2 <= l1 &&
strcmp(name+(l1-l2),pattern) == 0 &&
} else {
int l1 = strlen(name);
int l2 = strlen(pattern);
if (l2 <= l1 &&
strcmp(name+(l1-l2),pattern) == 0 &&
- (l1==l2 || (!match_start && name[l1-(l2+1)] == '/')))
+ (l1==l2 || (!match_start && name[l1-(l2+1)] == '/'))) {
/* 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)
/* 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)
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. */
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 ISASCII(c) 1
# if defined STDC_HEADERS || !defined isascii
# define ISASCII(c) 1
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
-#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+#endif
+#ifndef FNM_LEADING_DIR
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
+#endif
+#ifndef FNM_CASEFOLD
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif