Code

Fix set_keymap to error when resolving an unknown keymap
authorJonas Fonseca <fonseca@diku.dk>
Thu, 22 Apr 2010 01:53:56 +0000 (21:53 -0400)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 22 Apr 2010 01:57:56 +0000 (21:57 -0400)
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.

NEWS
tig.c

diff --git a/NEWS b/NEWS
index b3eeb497a9ab2262817b2927edd8398e94fb3ae4..59d748947cdea0b7b5936c85c50ac04f4c5a19bb 100644 (file)
--- 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 7cdd3eaa3371202ed2016eec4cb2e9ec03545295..49ef43727a3925d409276907fe0241ecb7023261 100644 (file)
--- 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;
        }