do not output incomplete multibyte chars in ^R
This commit is contained in:
parent
b446727285
commit
b22af76755
6
edit.c
6
edit.c
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#ifndef MKSH_NO_CMDLINE_EDITING
|
#ifndef MKSH_NO_CMDLINE_EDITING
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.314 2017/04/02 15:00:40 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.315 2017/04/02 15:42:59 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* in later versions we might use libtermcap for this, but since external
|
* in later versions we might use libtermcap for this, but since external
|
||||||
@ -2937,6 +2937,10 @@ x_e_putc3(const char **cp)
|
|||||||
char *cp2;
|
char *cp2;
|
||||||
|
|
||||||
width = utf_widthadj(*cp, (const char **)&cp2);
|
width = utf_widthadj(*cp, (const char **)&cp2);
|
||||||
|
if (cp2 == *cp + 1) {
|
||||||
|
(*cp)++;
|
||||||
|
shf_puts("\xEF\xBF\xBD", shl_out);
|
||||||
|
} else
|
||||||
while (*cp < cp2)
|
while (*cp < cp2)
|
||||||
x_putcf(*(*cp)++);
|
x_putcf(*(*cp)++);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user