diff options
author | portix <portix@gmx.net> | 2012-01-04 19:41:56 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-01-04 19:41:56 +0100 |
commit | 22966fd0223f04394009587429041c148d1dddac (patch) | |
tree | 1e331b7b7920875425e02e4f6c6bf61b14fd161c /src/commands.c | |
parent | 234e2121926a983279fd341c203eff8318e8b512 (diff) | |
download | dwb-22966fd0223f04394009587429041c148d1dddac.zip |
Fixing segfault in save_session
Diffstat (limited to 'src/commands.c')
-rw-r--r-- | src/commands.c | 27 |
1 files changed, 16 insertions, 11 deletions
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; |