From patchwork Tue Aug 22 18:21:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 110694 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp3055976qge; Tue, 22 Aug 2017 11:21:37 -0700 (PDT) X-Received: by 10.98.218.28 with SMTP id c28mr85487pfh.4.1503426096997; Tue, 22 Aug 2017 11:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503426096; cv=none; d=google.com; s=arc-20160816; b=pOCGzlSNhiXanejVcMPM4MaXfjzFY85k7jKHKRmzzh055mmhabkGPcecyMI/GN7tjo HOjGVKY6lpSrf15Cvan6B8iEk5EmW5rP8TfoaYQuDipnJLtmJ20p5QZObcqNpIsQbRL4 HEgYSCHzYF+eVyMOZbdo36HSCV2dKPGmfSQevSLOTvqieNgeBBfWj8YCqr1ZXgE7X79Z +w1o39yQBriZSUM1Kk2Mhh3DyW4xF8aM3dtX6Xpr3wGPIzESmSQcRsYrtnZ4dWjtWktY 59nsDkt2TdCuW4l7OnTEC4NFim9FuuoRi4LhZklZuqiuCTVJZn8CMopmv9nrVYx2DLLf cDHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=3GCBBRcmB3PVH6fgyiIybp4cUeuO4mDRZFOaZelLC40=; b=nr08/rV3jmk16d+PWv/0cY1e0ETIpr6BzHTDSRHfN47QNIMi073bGUg34W26s/1E1O QLxDTI3bwb05d98Trb1gXwm999LqQ90W64NsqpmtKt2/P50C1ec8/DEpKzkU8fQSkY0q no1P+jnnFcmKNnns5S3RyKUzvALgYfWyTgJ5iugj6RQukLFK4J3jEqcrEmhvdL1waaZx zWKvl5dQWkGvioT/I8bk1Kr4jsKoHPEydH4mFxfkijwkcYl3ohZia1oHPt/t1dz0kJ84 3WHw4mVlEOJ225eak1ektAXsKgr7ymQ7CdVV+b9tkMwDWraIEcMAiN0MUu4PYk+x2UKP kYcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Mcr0BF1v; spf=pass (google.com: domain of libc-alpha-return-83664-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-83664-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s65si6333471pfd.524.2017.08.22.11.21.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Aug 2017 11:21:36 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-83664-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Mcr0BF1v; spf=pass (google.com: domain of libc-alpha-return-83664-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-83664-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=LKDBl/0rf2JKNN+lmBZNYmFFI0DF1Or blHvymQrcua1Y2hIgMwq3YPj4ujldR9BgTOuaAsQv/Y+A5OKPgrwvmRV5l0ngeaR cHCxUr/6/X81FBfyAs80DR/KznuoGwN7tBHMASZWeZaJrXiKzxivVt9Pdhrl8rj0 vFPXjeuGpZkA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=LyAW8EywJMQSECZD1z/BQS969eE=; b=Mcr0B F1vxC2baM492gfR3IvGu04E94zHZkdnVi6nV0D67/nyhm+xuf1qUEZYqfsY8u8Tl zp+QmuCWdod8pFrw2cY8ViDPdduxLDVd0FVAGYzSXYhlo21Ai8eaujsaCGWDoX1p FE4hw9qAiTqE2SG+p2txiJj0nUbSnjMVr6b4BA= Received: (qmail 70072 invoked by alias); 22 Aug 2017 18:21:21 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 69990 invoked by uid 89); 22 Aug 2017 18:21:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f173.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3GCBBRcmB3PVH6fgyiIybp4cUeuO4mDRZFOaZelLC40=; b=BJuu7TSQFT7lN9VKwwpIUdAiaDSDxymAqgopzCYOVlhuh8Iyi1LGnLNFqr7O7h5uZr PDKCArJY7Hnn1NIkXX1E7AiawknFIeJjcZ7OvOihWTCgsZi+V8b2G8V7RwOu/4h/SM1m ezNpTwO4dUBSTXxXT2fSoCC63Lt/Hgo6+hKmK7q4gWs/N8YN1B2WJuS4w7xwlJBSRVZ0 RLXMb2Ex2R/BGy4ynA55tpw7WT4RCW9Qy+10K4Oc6+NZtl9MUyy7RF2iPGEuiZrr/BPX 92rKd1a4gjRJTJgFwqxZ4NUSH07XwDEnmOwuSBxryHMNPwPFb7a+rf9nB0TVXtgb4lAu xbPQ== X-Gm-Message-State: AHYfb5h4xOa/ujFPZyYkrjK3GH1P6gJdV3kDIXXH7/VFgFPpg8cJ+HJq Uxxg6PCTD7ldmZP3KIk5hQ== X-Received: by 10.55.128.1 with SMTP id b1mr119286qkd.76.1503426073368; Tue, 22 Aug 2017 11:21:13 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 2/3] posix: De-couple code from gnulib Date: Tue, 22 Aug 2017 15:21:03 -0300 Message-Id: <1503426064-2827-3-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1503426064-2827-1-git-send-email-adhemerval.zanella@linaro.org> References: <1503426064-2827-1-git-send-email-adhemerval.zanella@linaro.org> This patch removed unecessary code for non-supported platforms and modes (basically windows and amiga) from glob. It also fixes some ifdef indentations. No code change is expected. Tested on x86_64-linux-gnu. * posix/glob.c (glob_in_dir): Remove win32 and amiga support. (glob): Likewise. (prefix_array): Likewise. (glob_in_dir): Likewise. --- posix/glob.c | 296 ++++++++++++++++------------------------------------------- 1 file changed, 78 insertions(+), 218 deletions(-) -- 2.7.4 diff --git a/posix/glob.c b/posix/glob.c index 5e4b7fc..d33f9ab 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -15,91 +15,71 @@ License along with the GNU C Library; if not, see . */ -#ifndef _LIBC -/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc - optimizes away the pattern == NULL || pglob == NULL tests below. */ -# define _GL_ARG_NONNULL(params) -# include -#endif - #include - #include #include #include #include #include #include - -/* Outcomment the following line for production quality code. */ -/* #define NDEBUG 1 */ #include -#include /* Needed on stupid SunOS for assert. */ - #ifndef GLOB_ONLY_P +# include +# if !defined POSIX && defined _POSIX_VERSION +# define POSIX +# endif -#include -#if !defined POSIX && defined _POSIX_VERSION -# define POSIX -#endif +# include -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -# define WINDOWS32 -#endif +# include +# ifndef __set_errno +# define __set_errno(val) errno = (val) +# endif -#ifndef WINDOWS32 -# include -#endif +# include +# include +# include +# include -#include -#ifndef __set_errno -# define __set_errno(val) errno = (val) -#endif +# ifdef _LIBC +# undef strdup +# define strdup(str) __strdup (str) +# define sysconf(id) __sysconf (id) +# define closedir(dir) __closedir (dir) +# define opendir(name) __opendir (name) +# define readdir(str) __readdir64 (str) +# define getpwnam_r(name, bufp, buf, len, res) \ + __getpwnam_r (name, bufp, buf, len, res) +# ifndef __stat64 +# define __stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf) +# endif +# define struct_stat64 struct stat64 +# else /* !_LIBC */ +# define __getlogin_r(buf, len) getlogin_r (buf, len) +# define __stat64(fname, buf) stat (fname, buf) +# define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag) +# define struct_stat64 struct stat +# ifndef __MVS__ +# define __alloca alloca +# endif +# define __readdir readdir +# define __glob_pattern_p glob_pattern_p +# define COMPILE_GLOB64 +# endif /* _LIBC */ + +# include -#include -#include -#include -#include - -#ifdef _LIBC -# undef strdup -# define strdup(str) __strdup (str) -# define sysconf(id) __sysconf (id) -# define closedir(dir) __closedir (dir) -# define opendir(name) __opendir (name) -# define readdir(str) __readdir64 (str) -# define getpwnam_r(name, bufp, buf, len, res) \ - __getpwnam_r (name, bufp, buf, len, res) -# ifndef __stat64 -# define __stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf) +# ifdef _SC_GETPW_R_SIZE_MAX +# define GETPW_R_SIZE_MAX() sysconf (_SC_GETPW_R_SIZE_MAX) +# else +# define GETPW_R_SIZE_MAX() (-1) # endif -# define struct_stat64 struct stat64 -#else /* !_LIBC */ -# define __getlogin_r(buf, len) getlogin_r (buf, len) -# define __stat64(fname, buf) stat (fname, buf) -# define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag) -# define struct_stat64 struct stat -# ifndef __MVS__ -# define __alloca alloca +# ifdef _SC_LOGIN_NAME_MAX +# define GET_LOGIN_NAME_MAX() sysconf (_SC_LOGIN_NAME_MAX) +# else +# define GET_LOGIN_NAME_MAX() (-1) # endif -# define __readdir readdir -# define __glob_pattern_p glob_pattern_p -# define COMPILE_GLOB64 -#endif /* _LIBC */ - -#include - -#ifdef _SC_GETPW_R_SIZE_MAX -# define GETPW_R_SIZE_MAX() sysconf (_SC_GETPW_R_SIZE_MAX) -#else -# define GETPW_R_SIZE_MAX() (-1) -#endif -#ifdef _SC_LOGIN_NAME_MAX -# define GET_LOGIN_NAME_MAX() sysconf (_SC_LOGIN_NAME_MAX) -#else -# define GET_LOGIN_NAME_MAX() (-1) -#endif static const char *next_brace_sub (const char *begin, int flags) __THROWNL; @@ -151,7 +131,7 @@ readdir_result_might_be_dir (struct readdir_result d) # endif /* defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE */ -# if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__ +# if defined _LIBC || defined D_INO_IN_DIRENT /* Initializer for skip_entry. POSIX does not require that the d_ino field be present, and some systems do not provide it. */ # define D_INO_TO_RESULT(source) false, @@ -161,20 +141,20 @@ readdir_result_might_be_dir (struct readdir_result d) /* Construct an initializer for a struct readdir_result object from a struct dirent *. No copy of the name is made. */ -#define READDIR_RESULT_INITIALIZER(source) \ +# define READDIR_RESULT_INITIALIZER(source) \ { \ source->d_name, \ D_TYPE_TO_RESULT (source) \ D_INO_TO_RESULT (source) \ } -#endif /* !defined GLOB_ONLY_P */ +# endif /* !defined GLOB_ONLY_P */ /* Call gl_readdir on STREAM. This macro can be overridden to reduce type safety if an old interface version needs to be supported. */ -#ifndef GL_READDIR -# define GL_READDIR(pglob, stream) ((pglob)->gl_readdir (stream)) -#endif +# ifndef GL_READDIR +# define GL_READDIR(pglob, stream) ((pglob)->gl_readdir (stream)) +# endif /* Extract name and type from directory entry. No copy of the name is made. If SOURCE is NULL, result name is NULL. Keep in sync with @@ -191,7 +171,7 @@ convert_dirent (const struct dirent *source) return result; } -#ifndef COMPILE_GLOB64 +# ifndef COMPILE_GLOB64 /* Like convert_dirent, but works on struct dirent64 instead. Keep in sync with convert_dirent above. */ static struct readdir_result @@ -205,44 +185,27 @@ convert_dirent64 (const struct dirent64 *source) struct readdir_result result = READDIR_RESULT_INITIALIZER (source); return result; } -#endif - - -#ifndef attribute_hidden -# define attribute_hidden -#endif - -#ifndef __attribute_noinline__ -# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1) -# define __attribute_noinline__ /* Ignore */ -#else -# define __attribute_noinline__ __attribute__ ((__noinline__)) # endif -#endif - -#ifndef __glibc_unlikely -# define __glibc_unlikely(expr) __builtin_expect (expr, 0) -#endif -#ifndef _LIBC +# ifndef _LIBC /* The results of opendir() in this file are not used with dirfd and fchdir, and we do not leak fds to any single-threaded code that could use stdio, therefore save some unnecessary recursion in fchdir.c and opendir_safer.c. FIXME - if the kernel ever adds support for multi-thread safety for avoiding standard fds, then we should use opendir_safer. */ -# ifdef GNULIB_defined_opendir -# undef opendir -# endif -# ifdef GNULIB_defined_closedir -# undef closedir -# endif +# ifdef GNULIB_defined_opendir +# undef opendir +# endif +# ifdef GNULIB_defined_closedir +# undef closedir +# endif /* Just use malloc. */ -# define __libc_use_alloca(n) false -# define alloca_account(len, avar) ((void) (len), (void) (avar), (void *) 0) -# define extend_alloca_account(buf, len, newlen, avar) \ +# define __libc_use_alloca(n) false +# define alloca_account(len, avar) ((void) (len), (void) (avar), (void *) 0) +# define extend_alloca_account(buf, len, newlen, avar) \ ((void) (buf), (void) (len), (void) (newlen), (void) (avar), (void *) 0) -#endif +# endif /* Set *R = A + B. Return true if the answer is mathematically incorrect due to overflow; in this case, *R is the low order @@ -252,16 +215,16 @@ static bool size_add_wrapv (size_t a, size_t b, size_t *r); static bool glob_use_alloca (size_t alloca_used, size_t len); /* We must not compile this function twice. */ -#ifndef GLOB_COMPAT_BUILD +# ifndef GLOB_COMPAT_BUILD static bool size_add_wrapv (size_t a, size_t b, size_t *r) { -#if 5 <= __GNUC__ +# if 5 <= __GNUC__ return __builtin_add_overflow (a, b, r); -#else +# else *r = a + b; return *r < a; -#endif +# endif } static bool @@ -271,7 +234,7 @@ glob_use_alloca (size_t alloca_used, size_t len) return (!size_add_wrapv (alloca_used, len, &size) && __libc_use_alloca (size)); } -#endif +#endif /* GLOB_ONLY_P */ static int glob_in_dir (const char *pattern, const char *directory, int flags, int (*errfunc) (const char *, int), @@ -514,14 +477,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), /* Find the filename. */ filename = strrchr (pattern, '/'); -#if defined __MSDOS__ || defined WINDOWS32 - /* The case of "d:pattern". Since `:' is not allowed in - file names, we can safely assume that wherever it - happens in pattern, it signals the filename part. This - is so we could some day support patterns like "[a-z]:foo". */ - if (filename == NULL) - filename = strchr (pattern, ':'); -#endif /* __MSDOS__ || WINDOWS32 */ dirname_modified = 0; if (filename == NULL) { @@ -546,11 +501,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), } filename = pattern; -#ifdef _AMIGA - dirname = (char *) ""; -#else dirname = (char *) "."; -#endif dirlen = 0; } } @@ -567,24 +518,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), { char *newp; dirlen = filename - pattern; -#if defined __MSDOS__ || defined WINDOWS32 - if (*filename == ':' - || (filename > pattern + 1 && filename[-1] == ':')) - { - char *drive_spec; - - ++dirlen; - drive_spec = __alloca (dirlen + 1); - *((char *) mempcpy (drive_spec, pattern, dirlen)) = '\0'; - /* For now, disallow wildcards in the drive spec, to - prevent infinite recursion in glob. */ - if (__glob_pattern_p (drive_spec, !(flags & GLOB_NOESCAPE))) - return GLOB_NOMATCH; - /* If this is "d:pattern", we need to copy ':' to DIRNAME - as well. If it's "d:/pattern", don't remove the slash - from "d:/", since "d:" and "d:/" are not the same.*/ - } -#endif if (glob_use_alloca (alloca_used, dirlen + 1)) newp = alloca_account (dirlen + 1, alloca_used); else @@ -598,13 +531,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), dirname = newp; ++filename; - if (filename[0] == '\0' -#if defined __MSDOS__ || defined WINDOWS32 - && dirname[dirlen - 1] != ':' - && (dirlen < 3 || dirname[dirlen - 2] != ':' - || dirname[dirlen - 1] != '/') -#endif - && dirlen > 1) + if (filename[0] == '\0' && dirlen > 1) /* "pattern/". Expand "pattern", appending slashes. */ { int orig_flags = flags; @@ -648,32 +575,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), /* Look up home directory. */ char *home_dir = getenv ("HOME"); int malloc_home_dir = 0; -# ifdef _AMIGA - if (home_dir == NULL || home_dir[0] == '\0') - home_dir = "SYS:"; -# else -# ifdef WINDOWS32 - /* Windows NT defines HOMEDRIVE and HOMEPATH. But give preference - to HOME, because the user can change HOME. */ - if (home_dir == NULL || home_dir[0] == '\0') - { - const char *home_drive = getenv ("HOMEDRIVE"); - const char *home_path = getenv ("HOMEPATH"); - - if (home_drive != NULL && home_path != NULL) - { - size_t home_drive_len = strlen (home_drive); - size_t home_path_len = strlen (home_path); - char *mem = alloca (home_drive_len + home_path_len + 1); - - memcpy (mem, home_drive, home_drive_len); - memcpy (mem + home_drive_len, home_path, home_path_len + 1); - home_dir = mem; - } - else - home_dir = "c:/users/default"; /* poor default */ - } -# else if (home_dir == NULL || home_dir[0] == '\0') { int success; @@ -815,8 +716,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), malloc_home_dir = 0; } } -# endif /* WINDOWS32 */ -# endif /* Now construct the full directory. */ if (dirname[1] == '\0') { @@ -861,7 +760,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), } dirname_modified = 1; } -# if !defined _AMIGA && !defined WINDOWS32 else { char *end_name = strchr (dirname, '/'); @@ -1039,7 +937,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), } } } -# endif /* Not Amiga && not WINDOWS32. */ } /* Now test whether we looked for "~" or "~NAME". In this case we @@ -1167,20 +1064,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), { size_t old_pathc; -#ifdef SHELL - { - /* Make globbing interruptible in the bash shell. */ - extern int interrupt_state; - - if (interrupt_state) - { - globfree (&dirs); - retval = GLOB_ABORTED; - goto out; - } - } -#endif /* SHELL. */ - old_pathc = pglob->gl_pathc; status = glob_in_dir (filename, dirs.gl_pathv[i], ((flags | GLOB_APPEND) @@ -1387,9 +1270,9 @@ globfree (glob_t *pglob) pglob->gl_pathv = NULL; } } -#if defined _LIBC && !defined globfree +# if defined _LIBC && !defined globfree libc_hidden_def (globfree) -#endif +# endif /* Do a collated comparison of A and B. */ @@ -1418,31 +1301,12 @@ prefix_array (const char *dirname, char **array, size_t n) { size_t i; size_t dirlen = strlen (dirname); -#if defined __MSDOS__ || defined WINDOWS32 - int sep_char = '/'; -# define DIRSEP_CHAR sep_char -#else # define DIRSEP_CHAR '/' -#endif if (dirlen == 1 && dirname[0] == '/') /* DIRNAME is just "/", so normal prepending would get us "//foo". We want "/foo" instead, so don't prepend any chars from DIRNAME. */ dirlen = 0; -#if defined __MSDOS__ || defined WINDOWS32 - else if (dirlen > 1) - { - if (dirname[dirlen - 1] == '/' && dirname[dirlen - 2] == ':') - /* DIRNAME is "d:/". Don't prepend the slash from DIRNAME. */ - --dirlen; - else if (dirname[dirlen - 1] == ':') - { - /* DIRNAME is "d:". Use `:' instead of `/'. */ - --dirlen; - sep_char = ':'; - } - } -#endif for (i = 0; i < n; ++i) { @@ -1469,7 +1333,7 @@ prefix_array (const char *dirname, char **array, size_t n) /* We must not compile this function twice. */ -#ifndef NO_GLOB_PATTERN_P +# ifndef NO_GLOB_PATTERN_P int __glob_pattern_type (const char *pattern, int quote) { @@ -1512,10 +1376,10 @@ __glob_pattern_p (const char *pattern, int quote) { return __glob_pattern_type (pattern, quote) == 1; } -# ifdef _LIBC +# ifdef _LIBC weak_alias (__glob_pattern_p, glob_pattern_p) +# endif # endif -#endif /* We put this in a separate function mainly to allow the memory @@ -1666,11 +1530,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags, int dfd = (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0) ? -1 : dirfd ((DIR *) stream)); int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) - | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0) -#if defined _AMIGA || defined VMS - | FNM_CASEFOLD -#endif - ); + | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)); flags |= GLOB_MAGCHAR; while (1)