mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
gdb/tui: make use of a scoped_restore
Make use of a scoped_restore object in tui_mld_read_key instead of doing a manual save/restore. I don't think the existing code can throw an exception, so this is just a cleanup rather than a bug fix. There should be no user visible changes after this commit.
This commit is contained in:
@ -773,14 +773,10 @@ tui_mld_getc (FILE *fp)
|
|||||||
static int
|
static int
|
||||||
tui_mld_read_key (const struct match_list_displayer *displayer)
|
tui_mld_read_key (const struct match_list_displayer *displayer)
|
||||||
{
|
{
|
||||||
rl_getc_func_t *prev = rl_getc_function;
|
|
||||||
int c;
|
|
||||||
|
|
||||||
/* We can't use tui_getc as we need NEWLINE to not get emitted. */
|
/* We can't use tui_getc as we need NEWLINE to not get emitted. */
|
||||||
rl_getc_function = tui_mld_getc;
|
scoped_restore restore_getc_function
|
||||||
c = rl_read_key ();
|
= make_scoped_restore (&rl_getc_function, tui_mld_getc);
|
||||||
rl_getc_function = prev;
|
return rl_read_key ();
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TUI version of rl_completion_display_matches_hook.
|
/* TUI version of rl_completion_display_matches_hook.
|
||||||
|
Reference in New Issue
Block a user