summaryrefslogtreecommitdiff
path: root/lib/glob/glob.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-09 16:13:32 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-09 16:15:01 -0700
commit2d698b6e42d8dca191ac795ef5dba3bf62496eec (patch)
treeac5e0b67043c50f49160e9fe407435706cf30444 /lib/glob/glob.c
parentf1250933e4a2ac09a3d0b25b3877068e12f44da5 (diff)
downloadvyatta-bash-2d698b6e42d8dca191ac795ef5dba3bf62496eec.tar.gz
vyatta-bash-2d698b6e42d8dca191ac795ef5dba3bf62496eec.zip
Integrate bash 3.2 version
This is merge of current Debian stable (Lenny) version of Bash with Vyatta changes.
Diffstat (limited to 'lib/glob/glob.c')
-rw-r--r--lib/glob/glob.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/glob/glob.c b/lib/glob/glob.c
index 1453b06..08a7da8 100644
--- a/lib/glob/glob.c
+++ b/lib/glob/glob.c
@@ -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 */
@@ -470,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;
@@ -541,6 +541,9 @@ 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)