diff --git a/src/fe-common/core/command-history.c b/src/fe-common/core/command-history.c index aeafa6c8..c1e1bcdc 100644 --- a/src/fe-common/core/command-history.c +++ b/src/fe-common/core/command-history.c @@ -106,14 +106,14 @@ HISTORY_REC *command_history_current(WINDOW_REC *window) void command_history_clear(WINDOW_REC *window) { - if (window_history) { - if (command_history_destroy(window->history)) - window->history = command_history_create(NULL); - } - else { - if (command_history_destroy(global_history)) - global_history = command_history_create(NULL); - } + if (window_history) { + if (command_history_destroy(window->history)) + window->history = command_history_create(NULL); + } + else { + if (command_history_destroy(global_history)) + global_history = command_history_create(NULL); + } } const char *command_history_prev(WINDOW_REC *window, const char *text) diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index 201bf394..8b31a507 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -628,11 +628,11 @@ void cmd_window_history(const char *data) return; if (*name == '\0' && g_hash_table_lookup(optlist, "clear") != NULL) - command_history_clear(active_win); - else if (*name != '\0') - window_set_history(active_win, name); + command_history_clear(active_win); + else if (*name != '\0') + window_set_history(active_win, name); - cmd_params_free(free_arg); + cmd_params_free(free_arg); } /* we're moving the first window to last - move the first contiguous block