fix for @ and * as associative array keys in arithmetic expressions; minor readline callback mode changes

This commit is contained in:
Chet Ramey
2022-11-02 16:23:12 -04:00
parent b48c234286
commit 88d69b4fa2
9 changed files with 4198 additions and 3 deletions
+13 -1
View File
@@ -463,6 +463,11 @@ add_character:
{
rl_stuff_char (cxt->lastc);
rl_execute_next (cxt->prevc);
/* We're going to read the last two characters again. */
_rl_del_executing_keyseq ();
_rl_del_executing_keyseq ();
/* XXX - do we insert everything in cxt->pmb? */
return (0);
}
@@ -477,6 +482,8 @@ add_character:
/* Make lastc be the next character read */
/* XXX - do we insert everything in cxt->mb? */
rl_execute_next (cxt->lastc);
_rl_del_executing_keyseq ();
/* Dispatch on the previous character (insert into search string) */
cxt->lastc = cxt->prevc;
#if defined (HANDLE_MULTIBYTE)
@@ -524,7 +531,10 @@ add_character:
settable keyboard timeout value, this could alternatively
use _rl_input_queued(100000) */
if (cxt->lastc == ESC && (_rl_pushed_input_available () || _rl_input_available ()))
rl_execute_next (ESC);
{
rl_execute_next (ESC);
_rl_del_executing_keyseq ();
}
return (0);
}
@@ -536,6 +546,7 @@ add_character:
/* This sets rl_pending_input to LASTC; it will be picked up the next
time rl_read_key is called. */
rl_execute_next (cxt->lastc);
_rl_del_executing_keyseq ();
return (0);
}
}
@@ -546,6 +557,7 @@ add_character:
/* This sets rl_pending_input to LASTC; it will be picked up the next
time rl_read_key is called. */
rl_execute_next (cxt->lastc);
_rl_del_executing_keyseq ();
return (0);
}
+1
View File
@@ -235,6 +235,7 @@ rl_digit_argument (int ignore, int key)
else
{
rl_execute_next (key);
_rl_del_executing_keyseq ();
return (rl_digit_loop ());
}
}
+5
View File
@@ -566,6 +566,7 @@ readline_internal_charloop (void)
{
static int lastc, eof_found;
int c, code, lk, r;
static procenv_t olevel;
lastc = EOF;
@@ -576,6 +577,9 @@ readline_internal_charloop (void)
#endif
lk = _rl_last_command_was_kill;
/* Save and restore _rl_top_level even though most of the time it
doesn't matter. */
memcpy ((void *)olevel, (void *)_rl_top_level, sizeof (procenv_t));
#if defined (HAVE_POSIX_SIGSETJMP)
code = sigsetjmp (_rl_top_level, 0);
#else
@@ -586,6 +590,7 @@ readline_internal_charloop (void)
{
(*rl_redisplay_function) ();
_rl_want_redisplay = 0;
memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));
/* If we longjmped because of a timeout, handle it here. */
if (RL_ISSTATE (RL_STATE_TIMEOUT))