From: Jonas Fonseca Date: Thu, 22 Apr 2010 01:53:56 +0000 (-0400) Subject: Fix set_keymap to error when resolving an unknown keymap X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=aa6d1129b336af4f95636bac0b3d857c4c698179;p=tig.git Fix set_keymap to error when resolving an unknown keymap The underlying interface was changed in commit f50084da to return TRUE/FALSE instead of OK/ERR, but the only usage of set_keymap was not updated. This lead to a potential segmentation fault. Reported by Simon Ruderich. --- diff --git a/NEWS b/NEWS index b3eeb49..59d7489 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,7 @@ Bug fixes: - Fix parsing of boolean show-date values. - Fix relative date. - Fix unbind to behave as if the keybinding was never defined. + - Fix parsing of unknown keymap names. tig-0.15 -------- diff --git a/tig.c b/tig.c index 7cdd3ea..49ef437 100644 --- a/tig.c +++ b/tig.c @@ -2009,7 +2009,7 @@ option_bind_command(int argc, const char *argv[]) return ERR; } - if (set_keymap(&keymap, argv[0]) == ERR) { + if (!set_keymap(&keymap, argv[0])) { config_msg = "Unknown key map"; return ERR; }