From 754503c60d7323a7456f4458da9d80138d32b4ba Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 20 Aug 2006 22:28:17 +0000 Subject: 22651: failed to unmetafy bytes for output --- ChangeLog | 3 +++ Src/Zle/complist.c | 16 +++++++++++++--- Src/Zle/zle_tricky.c | 20 ++++++++++++++++---- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ecc2213a2..311ee1082 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-08-20 Peter Stephenson + * 22651: Src/Zle/complist.c, Src/Zle/zle_tricky.c: failed to + unmetafy bytes for output. + * 22650: Src/Modules/zutil.c: when deleting styles, the pointer to the last style can become invalid. diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 421901b78..886b4a685 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -621,7 +621,11 @@ clprintfmt(Listcols c, char *p, int ml) if (ml == mlend - 1 && (cc % columns) == columns - 1) return 0; - putc(*p, shout); + if (*p == Meta) { + p++; + putc(*p ^ 32, shout); + } else + putc(*p, shout); if ((beg = !(cc % columns))) ml++; if (mscroll && !(cc % columns) && @@ -1137,8 +1141,14 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop) dopr = 0; continue; } - while (len--) - putc(*p++, shout); + while (len--) { + if (*p == Meta) { + len--; + p++; + putc(*p++ ^ 32, shout); + } else + putc(*p++, shout); + } if ((beg = !(cc % columns)) && !stat) { ml++; fputs(" \010", shout); diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index b25dea6e7..0983bec31 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -2123,9 +2123,15 @@ printfmt(char *fmt, int n, int dopr, int doesc) tcout(TCUNDERLINEEND); break; case '{': - for (p++; *p && (*p != '%' || p[1] != '}'); p++) - if (dopr) + for (p++; *p && (*p != '%' || p[1] != '}'); p++) { + if (*p == Meta) { + p++; + if (dopr) + putc(*p ^ 32, shout); + } + else if (dopr) putc(*p, shout); + } if (*p) p++; else @@ -2164,8 +2170,14 @@ printfmt(char *fmt, int n, int dopr, int doesc) convchar_t cchar; int clen = MB_METACHARLENCONV(p, &cchar); if (dopr) { - while (clen--) - putc(*p++, shout); + while (clen--) { + if (*p == Meta) { + p++; + clen--; + putc(*p++ ^ 32, shout); + } else + putc(*p++, shout); + } } else p += clen; cc += WCWIDTH(cchar); -- cgit 1.4.1