From 8a0f00ae6fbc40b00cc029af6c74dcbb88d7977b Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 26 May 2023 20:33:54 +0300 Subject: [PATCH] (edit_load_macro_cmd): reduce variable scope. Signed-off-by: Andrew Borodin --- src/editor/editmacros.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/editor/editmacros.c b/src/editor/editmacros.c index 425b0c04e..8545d6742 100644 --- a/src/editor/editmacros.c +++ b/src/editor/editmacros.c @@ -249,7 +249,6 @@ edit_load_macro_cmd (WEdit * edit) { int hotkey; GArray *macros = NULL; - macros_t macro; values = mc_config_get_string_list (macros_config, section_name, *profile_keys, NULL); hotkey = tty_keyname_to_keycode (*profile_keys, NULL); @@ -296,8 +295,11 @@ edit_load_macro_cmd (WEdit * edit) if (macros != NULL) { - macro.hotkey = hotkey; - macro.macro = macros; + macros_t macro = { + .hotkey = hotkey, + .macro = macros + }; + g_array_append_val (macros_list, macro); }