nano

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

commit ab0897072a237121105d924b56a3051790de55bc
parent b2ff57467874e1c0cfad146a76acf0d9f3a0084c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 12 Jul 2018 10:51:15 +0200

input: consume the whole escape sequence for modified PgUp and PgDn keys

Even when we don't act on most of these combinations, at least eat up
the whole sequence so the unknown keystroke doesn't enter things like
"3~" into the buffer.

This fixes https://savannah.gnu.org/bugs/?54291.

Diffstat:
Msrc/winio.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -1094,10 +1094,10 @@ int convert_sequence(const int *seq, size_t length, int *consumed) if (length > 2 && (seq[2] == '~' || seq[2] == '^')) return KEY_PPAGE; #ifndef NANO_TINY - else if (length > 4 && seq[2] == ';' && - seq[3] == '2' && seq[4] == '~') { + else if (length > 4 && seq[2] == ';' && seq[4] == '~') { *consumed = 5; - return shiftaltup; + if (seq[3] == '2') + return shiftaltup; } #endif break; @@ -1107,10 +1107,10 @@ int convert_sequence(const int *seq, size_t length, int *consumed) if (length > 2 && (seq[2] == '~' || seq[2] == '^')) return KEY_NPAGE; #ifndef NANO_TINY - else if (length > 4 && seq[2] == ';' && - seq[3] == '2' && seq[4] == '~') { + else if (length > 4 && seq[2] == ';' && seq[4] == '~') { *consumed = 5; - return shiftaltdown; + if (seq[3] == '2') + return shiftaltdown; } #endif break;