summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d27080b)
raw | patch | inline | side by side (parent: d27080b)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 28 Sep 2006 11:51:38 +0000 (13:51 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Thu, 28 Sep 2006 11:51:38 +0000 (13:51 +0200) |
Fixes infinite loop repoted by Miciah. Also simply continue when wgetch
returns ERR (-1) instead of calling get_keybinding() etc.
returns ERR (-1) instead of calling get_keybinding() etc.
tig.c | patch | blob | history |
index aac7c4e23c90d548ebe9979bb157394d9f825aa3..6c2b7d08f8b460a286cc717363b4fb180ed03e02 100644 (file)
--- a/tig.c
+++ b/tig.c
static void
add_keybinding(enum keymap keymap, enum request request, int key)
{
- struct keybinding *keybinding = keybindings[keymap];
+ struct keybinding *keybinding;
- if (!keybinding)
- keybinding = calloc(1, sizeof(*keybinding));
+ keybinding = calloc(1, sizeof(*keybinding));
if (!keybinding)
die("Failed to allocate keybinding");
/* Refresh, accept single keystroke of input */
key = wgetch(status_win);
+ if (key == ERR)
+ continue;
request = get_keybinding(display[current_view]->keymap, key);