123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- --- a/glob.c (index)
- +++ b/glob.c (working tree)
- @@ -82,17 +82,19 @@ __FBSDID("$FreeBSD$");
- #include <ctype.h>
- #include <dirent.h>
- #include <errno.h>
- -#include <glob.h>
- +#include "glob.h"
- #include <limits.h>
- #include <pwd.h>
- #include <stdint.h>
- #include <stdio.h>
- -#include <stdlib.h>
- +#include "stdlib.h"
- #include <string.h>
- -#include <unistd.h>
- +#include "unistd.h"
- #include <wchar.h>
- +#ifdef USE_LOCALE_COLLATE
- #include "collate.h"
- +#endif
- /*
- * glob(3) expansion limits. Stop the expansion if any of these limits
- @@ -911,8 +913,10 @@ match(Char *name, Char *pat, Char *patend)
- {
- int ok, negate_range;
- Char c, k, *nextp, *nextn;
- +#ifdef USE_LOCALE_COLLATE
- struct xlocale_collate *table =
- (struct xlocale_collate*)__get_locale()->components[XLC_COLLATE];
- +#endif
- nextn = NULL;
- nextp = NULL;
- @@ -942,6 +946,7 @@ match(Char *name, Char *pat, Char *patend)
- ++pat;
- while (((c = *pat++) & M_MASK) != M_END)
- if ((*pat & M_MASK) == M_RNG) {
- +#ifdef USE_LOCALE_COLLATE
- if (table->__collate_load_error ?
- CHAR(c) <= CHAR(k) &&
- CHAR(k) <= CHAR(pat[1]) :
- @@ -949,6 +954,9 @@ match(Char *name, Char *pat, Char *patend)
- CHAR(k)) <= 0 &&
- __wcollate_range_cmp(CHAR(k),
- CHAR(pat[1])) <= 0)
- +#else
- + if (c <= k && k <= pat[1])
- +#endif
- ok = 1;
- pat += 2;
- } else if (c == k)
- --- a/stdlib.h (index)
- +++ b/stdlib.h (working tree)
- @@ -0,0 +1,3 @@
- +#include <stdlib.h>
- +
- +void* reallocarray(void*, size_t, size_t);
- --- a/unistd.h (index)
- +++ b/unistd.h (working tree)
- @@ -0,0 +1,3 @@
- +#include <unistd.h>
- +
- +#define issetugid() 0
- --- a/glob.h (index)
- +++ b/glob.h (working tree)
- @@ -39,12 +39,8 @@
- #define _GLOB_H_
- #include <sys/cdefs.h>
- -#include <sys/_types.h>
- +#include <sys/types.h>
- -#ifndef _SIZE_T_DECLARED
- -typedef __size_t size_t;
- -#define _SIZE_T_DECLARED
- -#endif
- struct stat;
- typedef struct {
- @@ -68,7 +64,7 @@ typedef struct {
- int (*gl_stat)(const char *, struct stat *);
- } glob_t;
- -#if __POSIX_VISIBLE >= 199209
- +// #if __POSIX_VISIBLE >= 199209
- /* Believed to have been introduced in 1003.2-1992 */
- #define GLOB_APPEND 0x0001 /* Append to output from previous call. */
- #define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
- @@ -83,9 +79,9 @@ typedef struct {
- #define GLOB_ABORTED (-2) /* Unignored error. */
- #define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */
- #define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */
- -#endif /* __POSIX_VISIBLE >= 199209 */
- +// #endif /* __POSIX_VISIBLE >= 199209 */
- -#if __BSD_VISIBLE
- +// #if __BSD_VISIBLE
- #define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
- #define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
- #define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
- @@ -97,7 +93,7 @@ typedef struct {
- /* source compatibility, these are the old names */
- #define GLOB_MAXPATH GLOB_LIMIT
- #define GLOB_ABEND GLOB_ABORTED
- -#endif /* __BSD_VISIBLE */
- +// #endif /* __BSD_VISIBLE */
- __BEGIN_DECLS
- int glob(const char * __restrict, int,
|