fix for memory leak with unset associative array elements; last set of changes to globbing bracket expressions; fix for timing subshell commands

This commit is contained in:
Chet Ramey
2022-11-23 17:03:34 -05:00
parent 94d25f57f1
commit 3c9dd45657
15 changed files with 6992 additions and 5359 deletions
+5 -3
View File
@@ -569,7 +569,9 @@ BRACKMATCH (p, test, flags)
if (!(flags & FNM_NOESCAPE) && c == L('\\'))
{
if (*p == '\0')
return (CHAR *)0;
return ((test == L('[')) ? savep : (CHAR *)0);
else if (*p == L('/') && (flags & FNM_PATHNAME))
return ((test == L('[')) ? savep : (CHAR *)0);
cstart = cend = *p++;
}
@@ -699,11 +701,11 @@ matched:
else if (!(flags & FNM_NOESCAPE) && c == L('\\'))
{
if (*p == '\0')
return (CHAR *)0;
return ((test == L('[')) ? savep : (CHAR *)0);
/* We don't allow backslash to quote slash if we're matching pathnames */
else if (*p == L('/') && (flags & FNM_PATHNAME))
return ((test == L('[')) ? savep : (CHAR *)0);
/* XXX 1003.2d11 is unclear if this is right. */
/* Posix issue 8 leaves this unspecified for the shell. */
++p;
}
}
+3
View File
@@ -282,6 +282,9 @@ parse-colors.o: ${BUILD_DIR}/config.h colors.h parse-colors.h
parse-colors.o: rldefs.h rlconf.h
parse-colors.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
input.o: posixselect.h posixtime.h
parens.o: posixselect.h posixtime.h
bind.o: rlshell.h
histfile.o: rlshell.h
nls.o: rlshell.h
+3 -3
View File
@@ -2271,9 +2271,9 @@ rl_completion_matches (const char *text, rl_compentry_func_t *entry_function)
char *
rl_username_completion_function (const char *text, int state)
{
#if defined (__WIN32__) || defined (__OPENNT)
#if defined (_WIN32) || defined (__OPENNT)
return (char *)NULL;
#else /* !__WIN32__ && !__OPENNT) */
#else /* !_WIN32 && !__OPENNT) */
static char *username = (char *)NULL;
static struct passwd *entry;
static int namelen, first_char, first_char_loc;
@@ -2322,7 +2322,7 @@ rl_username_completion_function (const char *text, int state)
return (value);
}
#endif /* !__WIN32__ && !__OPENNT */
#endif /* !_WIN32 && !__OPENNT */
}
/* Return non-zero if CONVFN matches FILENAME up to the length of FILENAME
+2 -2
View File
@@ -3374,7 +3374,7 @@ _rl_update_final (void)
full_lines = 1;
}
_rl_move_vert (_rl_vis_botlin);
woff = W_OFFSET(_rl_vis_botlin, wrap_offset);
woff = W_OFFSET(_rl_vis_botlin, wrap_offset); /* XXX - WRAP_OFFSET? */
botline_length = VIS_LLEN(_rl_vis_botlin) - woff;
/* If we've wrapped lines, remove the final xterm line-wrap flag. */
if (full_lines && _rl_term_autowrap && botline_length == _rl_screenwidth)
@@ -3383,7 +3383,7 @@ _rl_update_final (void)
/* LAST_LINE includes invisible characters, so if you want to get the
last character of the first line, you have to take WOFF into account.
This needs to be done for both calls to _rl_move_cursor_relative,
This needs to be done both for calls to _rl_move_cursor_relative,
which takes a buffer position as the first argument, and any direct
subscripts of LAST_LINE. */
last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]]; /* = VIS_CHARS(_rl_vis_botlin); */
+1 -1
View File
@@ -694,7 +694,7 @@ static int saved_history_logical_offset = -1;
#define HISTORY_FULL() (history_is_stifled () && history_length >= history_max_entries)
static int
set_saved_history ()
set_saved_history (void)
{
int absolute_offset, count;
+1
View File
@@ -708,6 +708,7 @@ readline_internal_charloop (void)
_rl_internal_char_cleanup ();
#if defined (READLINE_CALLBACKS)
memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));
return 0;
#else
}
+1 -1
View File
@@ -40,7 +40,7 @@
# if defined (HAVE_TERMIO_H)
# define TERMIO_TTY_DRIVER
# else
# if !defined (__MINGW32__)
# if !defined (__MINGW32__) && !defined (_WIN32)
# define NEW_TTY_DRIVER
# else
# define NO_TTY_DRIVER
+1
View File
@@ -548,6 +548,7 @@ uconvert.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h
uconvert.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h
ufuncs.o: ${topdir}/bashtypes.h
ufuncs.o: ${BASHINCDIR}/posixtime.h ${BASHINCDIR}/posixselect.h
clock.o: ${BASHINCDIR}/posixtime.h