about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-12-10 21:04:42 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-12-10 21:04:42 +0000
commit00e0c063ac23634fdbb0473a5f55c0738bc6bda9 (patch)
tree1ee4a74c558bb5603d792f6f63ec64ba18d84ef1
parentd06bc82c932b14a6750b1e06649513082ff6351a (diff)
downloadzsh-00e0c063ac23634fdbb0473a5f55c0738bc6bda9.tar.gz
zsh-00e0c063ac23634fdbb0473a5f55c0738bc6bda9.tar.xz
zsh-00e0c063ac23634fdbb0473a5f55c0738bc6bda9.zip
22069: completion listings didn't get unmetafied
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/complist.c16
2 files changed, 14 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index c532d86bd..d3e36cb7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-10  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 22069: Src/Zle/complist.c: completion listings didn't get
+	unmetafied.
+
 2005-12-10  Clint Adams  <clint@zsh.org>
 
 	* 22068: Completion/Debian/Command/_debdiff: completion
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index b1d807ac8..dac8850c6 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -879,10 +879,12 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
 	    fmt = mlistp;
     }
     for (p = fmt; *p; p++) {
-	if (doesc && *p == '%') {
-	    if (*++p) {
+	int chr = (*p == Meta) ? *++p ^ 32 : *p;
+	if (doesc && chr == '%') {
+	    chr = (*++p == Meta) ? *++p ^ 32 : *p;
+	    if (chr) {
 		m = 0;
-		switch (*p) {
+		switch (chr) {
 		case '%':
 		    if (dopr == 1)
 			putc('%', shout);
@@ -929,7 +931,7 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
 		case '{':
 		    for (p++; *p && (*p != '%' || p[1] != '}'); p++)
 			if (dopr)
-			    putc(*p, shout);
+			    putc(*p == Meta ? *++p ^ 32 : *p, shout);
 		    if (*p)
 			p++;
 		    else
@@ -1006,9 +1008,9 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
 	    } else
 		break;
 	} else {
-	    if ((++cc == columns - 2 || *p == '\n') && stat)
+	    if ((++cc == columns - 2 || chr == '\n') && stat)
 		dopr = 2;
-	    if (*p == '\n') {
+	    if (chr == '\n') {
 		if (dopr == 1 && mlbeg >= 0 && tccan(TCCLEAREOL))
 		    tcout(TCCLEAREOL);
 		l += 1 + ((cc - 1) / columns);
@@ -1019,7 +1021,7 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
 		    dopr = 0;
 		    continue;
 		}
-		putc(*p, shout);
+		putc(chr, shout);
 		if ((beg = !(cc % columns)) && !stat) {
 		    ml++;
                     fputs(" \010", shout);