mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-09 05:00:49 +02:00
commit bash-20190619 snapshot
This commit is contained in:
+21
-2
@@ -1,6 +1,6 @@
|
||||
/* glob.c -- file-name wildcard pattern matching for Bash.
|
||||
|
||||
Copyright (C) 1985-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne-Again SHell.
|
||||
|
||||
@@ -91,6 +91,7 @@ extern int signal_is_pending __P((int));
|
||||
extern void run_pending_traps __P((void));
|
||||
|
||||
extern int extended_glob;
|
||||
extern int posix_glob_backslash;
|
||||
|
||||
/* Global variable which controls whether or not * matches .*.
|
||||
Non-zero means don't match .*. */
|
||||
@@ -1410,7 +1411,25 @@ only_filename:
|
||||
|
||||
/* We could check whether or not the dequoted directory_name is a
|
||||
directory and return it here, returning the original directory_name
|
||||
if not, but we don't do that yet. I'm not sure it matters. */
|
||||
if not, but we don't do that. We do return the dequoted directory
|
||||
name if we're not being called recursively and the dequoted name
|
||||
corresponds to an actual directory. For better backwards compatibility,
|
||||
we can return &glob_error_return unconditionally in this case. */
|
||||
|
||||
if (directory_len > 0 && hasglob == 2 && (flags & GX_RECURSE) == 0)
|
||||
{
|
||||
#if 1
|
||||
dequote_pathname (directory_name);
|
||||
if (glob_testdir (directory_name, 0) < 0)
|
||||
{
|
||||
if (free_dirname)
|
||||
free (directory_name);
|
||||
return ((char **)&glob_error_return);
|
||||
}
|
||||
#else
|
||||
return ((char **)&glob_error_return);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Handle GX_MARKDIRS here. */
|
||||
result[0] = (char *) malloc (directory_len + 1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -70,7 +70,7 @@ INTERNAL_GLOB_PATTERN_P (pattern)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return bsquote ? 2 : 0;
|
||||
return ((bsquote && posix_glob_backslash) ? 2 : 0);
|
||||
}
|
||||
|
||||
#undef INTERNAL_GLOB_PATTERN_P
|
||||
|
||||
Reference in New Issue
Block a user