mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-03 16:59:22 +02:00
commit bash-20090917 snapshot
This commit is contained in:
+7
-3
@@ -309,9 +309,9 @@ dequote_pathname (pathname)
|
||||
# define GLOB_TESTNAME(name) (lstat (name, &finfo))
|
||||
#else /* !HAVE_LSTAT */
|
||||
# if !defined (AFS)
|
||||
# define GLOB_TESTNAME(name) (sh_eaccess (nextname, F_OK))
|
||||
# define GLOB_TESTNAME(name) (sh_eaccess (name, F_OK))
|
||||
# else /* AFS */
|
||||
# define GLOB_TESTNAME(name) (access (nextname, F_OK))
|
||||
# define GLOB_TESTNAME(name) (access (name, F_OK))
|
||||
# endif /* AFS */
|
||||
#endif /* !HAVE_LSTAT */
|
||||
|
||||
@@ -322,6 +322,7 @@ glob_testdir (dir)
|
||||
{
|
||||
struct stat finfo;
|
||||
|
||||
/*itrace("glob_testdir: testing %s", dir);*/
|
||||
if (stat (dir, &finfo) < 0)
|
||||
return (-1);
|
||||
|
||||
@@ -925,11 +926,14 @@ glob_filename (pathname, flags)
|
||||
{
|
||||
char **temp_results;
|
||||
|
||||
/* XXX -- we've recursively scanned any directories resulting from
|
||||
a `**', so turn off the flag. We turn it on again below if
|
||||
filename is `**' */
|
||||
/* Scan directory even on a NULL filename. That way, `*h/'
|
||||
returns only directories ending in `h', instead of all
|
||||
files ending in `h' with a `/' appended. */
|
||||
dname = directories[i];
|
||||
dflags = flags & ~GX_MARKDIRS;
|
||||
dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR);
|
||||
if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
|
||||
dflags |= GX_ALLDIRS|GX_ADDCURDIR;
|
||||
if (dname[0] == '\0' && filename[0])
|
||||
|
||||
+11
-5
@@ -246,7 +246,8 @@ udequote_pathname (pathname)
|
||||
if (pathname[i - 1] == 0)
|
||||
break;
|
||||
}
|
||||
pathname[j] = '\0';
|
||||
if (pathname)
|
||||
pathname[j] = '\0';
|
||||
}
|
||||
|
||||
#if HANDLE_MULTIBYTE
|
||||
@@ -279,7 +280,8 @@ wdequote_pathname (pathname)
|
||||
if (wpathname[i - 1] == L'\0')
|
||||
break;
|
||||
}
|
||||
wpathname[j] = L'\0';
|
||||
if (wpathname)
|
||||
wpathname[j] = L'\0';
|
||||
|
||||
/* Convert the wide character string into unibyte character set. */
|
||||
memset (&ps, '\0', sizeof(mbstate_t));
|
||||
@@ -307,9 +309,9 @@ dequote_pathname (pathname)
|
||||
# define GLOB_TESTNAME(name) (lstat (name, &finfo))
|
||||
#else /* !HAVE_LSTAT */
|
||||
# if !defined (AFS)
|
||||
# define GLOB_TESTNAME(name) (sh_eaccess (nextname, F_OK))
|
||||
# define GLOB_TESTNAME(name) (sh_eaccess (name, F_OK))
|
||||
# else /* AFS */
|
||||
# define GLOB_TESTNAME(name) (access (nextname, F_OK))
|
||||
# define GLOB_TESTNAME(name) (access (name, F_OK))
|
||||
# endif /* AFS */
|
||||
#endif /* !HAVE_LSTAT */
|
||||
|
||||
@@ -320,6 +322,7 @@ glob_testdir (dir)
|
||||
{
|
||||
struct stat finfo;
|
||||
|
||||
/*itrace("glob_testdir: testing %s", dir);*/
|
||||
if (stat (dir, &finfo) < 0)
|
||||
return (-1);
|
||||
|
||||
@@ -923,11 +926,14 @@ glob_filename (pathname, flags)
|
||||
{
|
||||
char **temp_results;
|
||||
|
||||
/* XXX -- we've recursively scanned any directories resulting from
|
||||
a `**', so turn off the flag. We turn it on below if
|
||||
necessary. */
|
||||
/* Scan directory even on a NULL filename. That way, `*h/'
|
||||
returns only directories ending in `h', instead of all
|
||||
files ending in `h' with a `/' appended. */
|
||||
dname = directories[i];
|
||||
dflags = flags & ~GX_MARKDIRS;
|
||||
dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR);
|
||||
if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
|
||||
dflags |= GX_ALLDIRS|GX_ADDCURDIR;
|
||||
if (dname[0] == '\0' && filename[0])
|
||||
|
||||
Reference in New Issue
Block a user