From a0703ab62d85733ff7222299d859d11e849df1f8 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 13 Feb 2020 13:46:31 +0100 Subject: [PATCH] tweaks: mesh two bits of code together --- src/winio.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/winio.c b/src/winio.c index 0f4f9a7b..1ff2aba6 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1594,17 +1594,16 @@ char *get_verbatim_kbinput(WINDOW *win, size_t *count) /* Read in a single byte or two escapes. */ input = parse_verbatim_kbinput(win, count); - /* If the code is invalid in the current mode, discard it. */ - if (input != NULL && ((*input == '\n' && as_an_at) || - (*input == '\0' && !as_an_at))) { - *count = 0; - beep(); - } - - /* If it is an incomplete Unicode sequence, stuff it back. */ - if (input != NULL && *input >= 0x80 && *count == 1) { - put_back(*input); - *count = 0; + /* If the byte is invalid in the current mode, discard it; + * if it is an incomplete Unicode sequence, stuff it back. */ + if (input != NULL) { + if ((*input == '\n' && as_an_at) || (*input == '\0' && !as_an_at)) { + *count = 0; + beep(); + } else if (*input >= 0x80 && *count == 1) { + put_back(*input); + *count = 0; + } } /* Turn flow control characters back on if necessary and turn the