nano

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

commit 07e69d54b21028a4f3ae02df973ad8ae7541bc00
parent aeb15e9549a6793eb0210ae3656ae346aa7d6458
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  9 Aug 2020 15:29:40 +0200

tweaks: elide two variables that are no longer needed, and update comment

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

diff --git a/src/winio.c b/src/winio.c @@ -810,24 +810,17 @@ int convert_CSI_sequence(const int *seq, size_t length, int *consumed) return FOREIGN_SEQUENCE; } -/* Interpret the escape sequence in the keystroke buffer, the first - * character of which is kbinput. Assume that the keystroke buffer - * isn't empty, and that the initial escape has already been read in. */ +/* Interpret an escape sequence that has the given post-ESC starter byte + * and with the rest of the sequence still in the keystroke buffer. */ int parse_escape_sequence(int starter) { - int *sequence, length; int consumed = 1; int keycode = 0; - /* Grab at most five integers (the longest possible escape sequence - * minus its first element) from the keybuffer. */ - length = (key_buffer_len < 5 ? key_buffer_len : 5); - sequence = key_buffer; - if (starter == 'O') - keycode = convert_SS3_sequence(sequence, length, &consumed); + keycode = convert_SS3_sequence(key_buffer, key_buffer_len, &consumed); else if (starter == '[') - keycode = convert_CSI_sequence(sequence, length, &consumed); + keycode = convert_CSI_sequence(key_buffer, key_buffer_len, &consumed); #ifndef NANO_TINY else die("Bad sequence starter -- please report a bug\n");