nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a0703ab62d85733ff7222299d859d11e849df1f8
parent 9d232cd8af35bbf70d53af82393404874772aab7
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 13 Feb 2020 13:46:31 +0100

tweaks: mesh two bits of code together

Diffstat:
Msrc/winio.c | 21++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git 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