Don't insert wchar_t if it can't be converted to mbs
Otherwise it could hit the assertion in editBuffer while converting to mbs for consumption by the rest of the program. It's possibly to trigger this with LC_ALL=C and typing C-z C-v M-a, for example.
This commit is contained in:
rodzic
a92f1260ea
commit
3b9e778dac
2
edit.c
2
edit.c
@ -260,6 +260,8 @@ void edit(uint id, enum Edit op, wchar_t ch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
break; case EditInsert: {
|
break; case EditInsert: {
|
||||||
|
char mb[MB_LEN_MAX];
|
||||||
|
if (wctomb(mb, ch) < 0) return;
|
||||||
if (reserve(pos, 1)) {
|
if (reserve(pos, 1)) {
|
||||||
buf[pos++] = ch;
|
buf[pos++] = ch;
|
||||||
}
|
}
|
||||||
|
Ładowanie…
x
Reference in New Issue
Block a user