about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-24 10:14:53 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-24 10:14:53 +0000
commit4b62f19a0ea664bc02e54f852444482b229adf0e (patch)
treee01666360f2beaa9ee8dcea8e226a6c2b8b363c7
parent870a0699ceede82eb498bfe9d0bad93909c8a9f5 (diff)
downloadzsh-4b62f19a0ea664bc02e54f852444482b229adf0e.tar.gz
zsh-4b62f19a0ea664bc02e54f852444482b229adf0e.tar.xz
zsh-4b62f19a0ea664bc02e54f852444482b229adf0e.zip
zsh-workers/9860
-rw-r--r--Src/Zle/compctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index fb1717f4d..9c4d42015 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -3763,10 +3763,11 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 	    for (ln = firstnode(matches); ln; ln = nextnode(ln)) {
 		m = (Cmatch) getdata(ln);
 		if (m->ppre) {
+		    char *s = (m->psuf ? m->psuf : "");
 		    char *p = (char *) zhalloc(strlen(m->ppre) + strlen(m->str) +
-					      strlen(m->psuf) + 1);
+					      strlen(s) + 1);
 
-		    sprintf(p, "%s%s%s", m->ppre, m->str, m->psuf);
+		    sprintf(p, "%s%s%s", m->ppre, m->str, s);
 		    addlinknode(args, dupstring(p));
 		} else
 		    addlinknode(args, dupstring(m->str));
@@ -3799,6 +3800,9 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 		endcmgroup(yaptr);
 		begcmgroup("default", 0);
 	    }
+	} else {
+	    endcmgroup(yaptr);
+	    begcmgroup("default", 0);
 	}
     } else if ((tt = cc->explain)) {
 	tt = dupstring(tt);