mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Fix null dereference in readline initialization
* guile-readline/readline.c (init_bouncing_parens): Check that the keymap is valid before using it.
This commit is contained in:
parent
17aab66e75
commit
c1fd55d174
1 changed files with 11 additions and 6 deletions
|
@ -431,12 +431,17 @@ static void init_bouncing_parens ();
|
||||||
static void
|
static void
|
||||||
init_bouncing_parens ()
|
init_bouncing_parens ()
|
||||||
{
|
{
|
||||||
if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2))
|
Keymap km = rl_get_keymap ();
|
||||||
|
if (km)
|
||||||
|
if (strncmp (rl_get_keymap_name (km), "vi", 2))
|
||||||
{
|
{
|
||||||
rl_bind_key (')', match_paren);
|
rl_bind_key (')', match_paren);
|
||||||
rl_bind_key (']', match_paren);
|
rl_bind_key (']', match_paren);
|
||||||
rl_bind_key ('}', match_paren);
|
rl_bind_key ('}', match_paren);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
scm_error (scm_misc_error_key, "", "readline has not been properly initialized",
|
||||||
|
SCM_EOL, SCM_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue