commit bash-20090512 snapshot

This commit is contained in:
Chet Ramey
2011-12-08 20:09:39 -05:00
parent 12ae1612a6
commit 94a5513e66
36 changed files with 6647 additions and 23 deletions
+22 -5
View File
@@ -665,9 +665,10 @@ glob_vector (pat, dir, flags)
(void) closedir (d);
}
/* compat: if GX_ALLDIRS, add the passed directory also, but don't add an
empty directory name. */
if (add_current && (flags & GX_NULLDIR) == 0)
/* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty
directory name as a placeholder if GX_NULLDIR (in which case the passed
directory name is "."). */
if (add_current)
{
sdlen = strlen (dir);
nextname = (char *)malloc (sdlen + 1);
@@ -679,7 +680,10 @@ glob_vector (pat, dir, flags)
nextlink->name = nextname;
nextlink->next = lastlink;
lastlink = nextlink;
bcopy (dir, nextname, sdlen + 1);
if (flags & GX_NULLDIR)
nextname[0] = '\0';
else
bcopy (dir, nextname, sdlen + 1);
++count;
}
}
@@ -1007,11 +1011,24 @@ glob_filename (pathname, flags)
/* Just return what glob_vector () returns appended to the
directory name. */
/* If flags & GX_ALLDIRS, we're called recursively */
dflags = flags & ~GX_MARKDIRS;
if (directory_len == 0)
dflags |= GX_NULLDIR;
if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
dflags |= GX_ALLDIRS|GX_ADDCURDIR;
{
dflags |= GX_ALLDIRS|GX_ADDCURDIR;
#if 0
/* If we want all directories (dflags & GX_ALLDIRS) and we're not
being called recursively as something like `echo **/*.o'
((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from
adding a null directory name to the front of the temp_results
array. We turn off ADDCURDIR if not called recursively and
dlen == 0 */
#endif
if (directory_len == 0 && (flags & GX_ALLDIRS) == 0)
dflags &= ~GX_ADDCURDIR;
}
temp_results = glob_vector (filename,
(directory_len == 0 ? "." : directory_name),
dflags);
+1073
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1089
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -131,9 +131,10 @@ static int _rl_vi_callback_char_search PARAMS((_rl_callback_generic_arg *));
void
_rl_vi_initialize_line ()
{
register int i;
register int i, n;
for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++)
n = sizeof (vi_mark_chars) / sizeof (vi_mark_chars[0]);
for (i = 0; i < n; i++)
vi_mark_chars[i] = -1;
RL_UNSETSTATE(RL_STATE_VICMDONCE);
File diff suppressed because it is too large Load Diff