Imported from ../bash-3.2.tar.gz.
This commit is contained in:
parent
95732b497d
commit
0628567a28
182 changed files with 17647 additions and 9477 deletions
|
|
@ -73,7 +73,7 @@
|
|||
#endif
|
||||
|
||||
extern void throw_to_top_level __P((void));
|
||||
extern int test_eaccess __P((char *, int));
|
||||
extern int sh_eaccess __P((char *, int));
|
||||
|
||||
extern int extended_glob;
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ mbskipname (pat, dname)
|
|||
{
|
||||
int ret;
|
||||
wchar_t *pat_wc, *dn_wc;
|
||||
size_t pat_n, dn_n, n;
|
||||
size_t pat_n, dn_n;
|
||||
|
||||
pat_n = xdupmbstowcs (&pat_wc, NULL, pat);
|
||||
dn_n = xdupmbstowcs (&dn_wc, NULL, dname);
|
||||
|
|
@ -293,7 +293,7 @@ dequote_pathname (pathname)
|
|||
# define GLOB_TESTNAME(name) (lstat (name, &finfo))
|
||||
#else /* !HAVE_LSTAT */
|
||||
# if !defined (AFS)
|
||||
# define GLOB_TESTNAME(name) (test_eaccess (nextname, F_OK))
|
||||
# define GLOB_TESTNAME(name) (sh_eaccess (nextname, F_OK))
|
||||
# else /* AFS */
|
||||
# define GLOB_TESTNAME(name) (access (nextname, F_OK))
|
||||
# endif /* AFS */
|
||||
|
|
@ -360,6 +360,7 @@ glob_vector (pat, dir, flags)
|
|||
count = lose = skip = 0;
|
||||
|
||||
firstmalloc = 0;
|
||||
nalloca = 0;
|
||||
|
||||
/* If PAT is empty, skip the loop, but return one (empty) filename. */
|
||||
if (pat == 0 || *pat == '\0')
|
||||
|
|
@ -469,7 +470,7 @@ glob_vector (pat, dir, flags)
|
|||
while (1)
|
||||
{
|
||||
/* Make globbing interruptible in the shell. */
|
||||
if (interrupt_state)
|
||||
if (interrupt_state || terminating_signal)
|
||||
{
|
||||
lose = 1;
|
||||
break;
|
||||
|
|
@ -540,12 +541,17 @@ glob_vector (pat, dir, flags)
|
|||
/* Here free the strings we have got. */
|
||||
while (lastlink)
|
||||
{
|
||||
/* Since we build the list in reverse order, the first N entries
|
||||
will be allocated with malloc, if firstmalloc is set, from
|
||||
lastlink to firstmalloc. */
|
||||
if (firstmalloc)
|
||||
{
|
||||
if (lastlink == firstmalloc)
|
||||
firstmalloc = 0;
|
||||
tmplink = lastlink;
|
||||
}
|
||||
else
|
||||
tmplink = 0;
|
||||
free (lastlink->name);
|
||||
lastlink = lastlink->next;
|
||||
FREE (tmplink);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue