commit bash-20210115 snapshot

This commit is contained in:
Chet Ramey
2021-01-19 17:12:43 -05:00
parent a9cf0031ef
commit 3aec0ec30f
11 changed files with 187 additions and 24 deletions
+8 -7
View File
@@ -1234,7 +1234,7 @@ parser_if (char *args)
#endif /* VI_MODE */
else if (_rl_strnicmp (args, "version", 7) == 0)
{
int rlversion, versionarg, op, previ, major, minor;
int rlversion, versionarg, op, previ, major, minor, opresult;
_rl_parsing_conditionalized_out = 1;
rlversion = RL_VERSION_MAJOR*10 + RL_VERSION_MINOR;
@@ -1294,24 +1294,25 @@ parser_if (char *args)
switch (op)
{
case OP_EQ:
_rl_parsing_conditionalized_out = rlversion == versionarg;
opresult = rlversion == versionarg;
break;
case OP_NE:
_rl_parsing_conditionalized_out = rlversion != versionarg;
opresult = rlversion != versionarg;
break;
case OP_GT:
_rl_parsing_conditionalized_out = rlversion > versionarg;
opresult = rlversion > versionarg;
break;
case OP_GE:
_rl_parsing_conditionalized_out = rlversion >= versionarg;
opresult = rlversion >= versionarg;
break;
case OP_LT:
_rl_parsing_conditionalized_out = rlversion < versionarg;
opresult = rlversion < versionarg;
break;
case OP_LE:
_rl_parsing_conditionalized_out = rlversion <= versionarg;
opresult = rlversion <= versionarg;
break;
}
_rl_parsing_conditionalized_out = 1 - opresult;
}
/* Check to see if the first word in ARGS is the same as the
value stored in rl_readline_name. */
+1 -3
View File
@@ -664,15 +664,13 @@ set_saved_history ()
}
int
rl_operate_and_get_next (count, c)
int count, c;
rl_operate_and_get_next (int count, int c)
{
/* Accept the current line. */
rl_newline (1, c);
saved_history_logical_offset = rl_explicit_arg ? count : where_history () + history_base + 1;
_rl_saved_internal_startup_hook = _rl_internal_startup_hook;
_rl_internal_startup_hook = set_saved_history;
+18 -10
View File
@@ -91,6 +91,8 @@ extern void _rl_parse_colors PARAMS((void)); /* XXX */
static char *readline_internal PARAMS((void));
static void readline_initialize_everything PARAMS((void));
static void run_startup_hooks PARAMS((void));
static void bind_arrow_keys_internal PARAMS((Keymap));
static void bind_arrow_keys PARAMS((void));
@@ -403,6 +405,16 @@ readline (const char *prompt)
return (value);
}
static void
run_startup_hooks (void)
{
if (rl_startup_hook)
(*rl_startup_hook) ();
if (_rl_internal_startup_hook)
(*_rl_internal_startup_hook) ();
}
#if defined (READLINE_CALLBACKS)
# define STATIC_CALLBACK
#else
@@ -422,11 +434,7 @@ readline_internal_setup (void)
if (_rl_enable_meta & RL_ISSTATE (RL_STATE_TERMPREPPED))
_rl_enable_meta_key ();
if (rl_startup_hook)
(*rl_startup_hook) ();
if (_rl_internal_startup_hook)
(*_rl_internal_startup_hook) ();
run_startup_hooks ();
rl_deactivate_mark ();
@@ -511,6 +519,11 @@ readline_internal_teardown (int eof)
void
_rl_internal_char_cleanup (void)
{
if (_rl_keep_mark_active)
_rl_keep_mark_active = 0;
else if (rl_mark_active_p ())
rl_deactivate_mark ();
#if defined (VI_MODE)
/* In vi mode, when you exit insert mode, the cursor moves back
over the previous character. We explicitly check for that here. */
@@ -668,11 +681,6 @@ readline_internal_charloop (void)
if (rl_pending_input == 0 && lk == _rl_last_command_was_kill)
_rl_last_command_was_kill = 0;
if (_rl_keep_mark_active)
_rl_keep_mark_active = 0;
else if (rl_mark_active_p ())
rl_deactivate_mark ();
_rl_internal_char_cleanup ();
#if defined (READLINE_CALLBACKS)
+7 -1
View File
@@ -68,6 +68,11 @@ extern int errno;
extern int shell_tty;
#if defined (READLINE)
/* Let's not call readline, forcing readline to initialize the termcap/terminfo
variables it needs, unless we have to. */
extern int interactive_shell;
extern int no_line_editing;
extern int bash_readline_initialized;
extern void rl_set_screen_size PARAMS((int, int));
#endif
extern void sh_set_lines_and_columns PARAMS((int, int));
@@ -87,7 +92,8 @@ get_new_window_size (from_sig, rp, cp)
{
sh_set_lines_and_columns (win.ws_row, win.ws_col);
#if defined (READLINE)
rl_set_screen_size (win.ws_row, win.ws_col);
if ((interactive_shell && no_line_editing == 0) || bash_readline_initialized)
rl_set_screen_size (win.ws_row, win.ws_col);
#endif
if (rp)
*rp = win.ws_row;