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.
master
Benno Schulenberg 2018-07-12 10:51:15 +02:00
parent b2ff574678
commit ab0897072a
1 changed files with 6 additions and 6 deletions

View File

@ -1094,9 +1094,9 @@ 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;
if (seq[3] == '2')
return shiftaltup;
}
#endif
@ -1107,9 +1107,9 @@ 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;
if (seq[3] == '2')
return shiftaltdown;
}
#endif