From 7e115b302491141dea4b9f0f22842f683f487298 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Wed, 13 Feb 2013 12:50:18 +0300 Subject: [PATCH] Code refactoring: removed unneeded 'go to' label. Signed-off-by: Slava Zanko Signed-off-by: Andrew Borodin --- lib/tty/key.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/tty/key.c b/lib/tty/key.c index 6c37a999d..41cc573b4 100644 --- a/lib/tty/key.c +++ b/lib/tty/key.c @@ -1744,20 +1744,18 @@ get_key_code (int no_delay) pend_send: if (pending_keys != NULL) { - int d = *pending_keys++; - check_pend: - if (*pending_keys == 0) - { - pending_keys = NULL; - seq_append = NULL; - } - if ((d == ESC_CHAR) && (pending_keys != NULL)) - { - d = ALT (*pending_keys++); - goto check_pend; - } - if ((d > 127 && d < 256) && use_8th_bit_as_meta) + int d; + + d = *pending_keys++; + while (d == ESC_CHAR && *pending_keys != '\0') + d = ALT (*pending_keys++); + + if (*pending_keys == '\0') + pending_keys = seq_append = NULL; + + if (d > 127 && d < 256 && use_8th_bit_as_meta) d = ALT (d & 0x7f); + this = NULL; return correct_key_code (d); } -- 2.11.4.GIT