From 22966fd0223f04394009587429041c148d1dddac Mon Sep 17 00:00:00 2001 From: portix Date: Wed, 4 Jan 2012 19:41:56 +0100 Subject: Fixing segfault in save_session --- src/commands.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/commands.c') diff --git a/src/commands.c b/src/commands.c index 6b2a9f24..e4711f4f 100644 --- a/src/commands.c +++ b/src/commands.c @@ -49,17 +49,22 @@ commands_simple_command(KeyMap *km) { completion_clean_autocompletion(); } - if ((ret = func(km, arg)) == STATUS_OK) { - if (km->map->hide == NEVER_SM) { - dwb_set_normal_message(dwb.state.fview, false, "%s:", km->map->n.second); - } - else if (km->map->hide == ALWAYS_SM) { - CLEAR_COMMAND_TEXT(); - gtk_widget_hide(dwb.gui.entry); - } - } - else if (ret == STATUS_ERROR) { - dwb_set_error_message(dwb.state.fview, arg->e ? arg->e : km->map->error); + ret = func(km, arg); + switch (ret) { + case STATUS_OK: + if (km->map->hide == NEVER_SM) + dwb_set_normal_message(dwb.state.fview, false, "%s:", km->map->n.second); + else if (km->map->hide == ALWAYS_SM) { + CLEAR_COMMAND_TEXT(); + gtk_widget_hide(dwb.gui.entry); + } + break; + case STATUS_ERROR: + dwb_set_error_message(dwb.state.fview, arg->e ? arg->e : km->map->error); + break; + case STATUS_END: + return; + default: break; } if (! km->map->arg.ro) km->map->arg.p = NULL; -- cgit v1.2.3