tweaks: mesh two bits of code together
parent
9d232cd8af
commit
a0703ab62d
13
src/winio.c
13
src/winio.c
|
@ -1594,18 +1594,17 @@ 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))) {
|
||||
/* 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();
|
||||
}
|
||||
|
||||
/* If it is an incomplete Unicode sequence, stuff it back. */
|
||||
if (input != NULL && *input >= 0x80 && *count == 1) {
|
||||
} else if (*input >= 0x80 && *count == 1) {
|
||||
put_back(*input);
|
||||
*count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Turn flow control characters back on if necessary and turn the
|
||||
* keypad back on if necessary now that we're done. */
|
||||
|
|
Loading…
Reference in New Issue