mirror of
https://github.com/tildeclub/ex-vi.git
synced 2026-06-26 21:49:25 +00:00
* Multibyte sequences that correspond to an unprintable character are now
printed as multiple octal escape sequences.
This commit is contained in:
18
ex_subr.c
18
ex_subr.c
@@ -73,7 +73,7 @@
|
||||
|
||||
#ifndef lint
|
||||
#ifdef DOSCCS
|
||||
static char sccsid[] = "@(#)ex_subr.c 1.32 (gritter) 12/2/04";
|
||||
static char sccsid[] = "@(#)ex_subr.c 1.33 (gritter) 1/12/05";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -560,6 +560,22 @@ printof(int c)
|
||||
char *nums = "01234567";
|
||||
int d;
|
||||
|
||||
#ifdef MB
|
||||
if (mb_cur_max > 1 && (c & INVBIT) == 0 && c & ~0177) {
|
||||
char mb[MB_LEN_MAX];
|
||||
int i, n, x = EOF;
|
||||
if ((n = wctomb(mb, c & TRIM)) <= 0) {
|
||||
n = 1;
|
||||
*mb = 0;
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
x = printof(mb[i] | INVBIT);
|
||||
if (i+1 < n)
|
||||
normchar(x);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
#endif /* MB */
|
||||
c &= 0377;
|
||||
if (c < 040 || c == DELETE) {
|
||||
normchar('^');
|
||||
|
||||
Reference in New Issue
Block a user