From 4b62f19a0ea664bc02e54f852444482b229adf0e Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 24 Feb 2000 10:14:53 +0000 Subject: zsh-workers/9860 --- Src/Zle/compctl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Src/Zle') 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); -- cgit 1.4.1