mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-03 08:11:03 +02:00
44997: GLOB_COMPLETE fix for compctl file completion.
Dashes could cause problems in directory prefixes.
This commit is contained in:
parent
06e27e940a
commit
ae58388619
2 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2019-12-10 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 44997: Src/Zle/compctl.c: prefix needed extra munging for
|
||||
hyphen with GLOB_COMPLETE in compctl.
|
||||
|
||||
2019-12-04 Oliver Kiddle <okiddle@yahoo.co.uk>
|
||||
|
||||
* 44976: Src/Zle/zle_main.c: describe-key-briefly in visual mode
|
||||
|
|
|
@ -3178,7 +3178,27 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
|
|||
/* Compute line prefix/suffix. */
|
||||
lpl = offs;
|
||||
lpre = zhalloc(lpl + 1);
|
||||
memcpy(lpre, s, lpl);
|
||||
if (comppatmatch)
|
||||
{
|
||||
int ccount;
|
||||
char *psrc, *pdst;
|
||||
for (ccount = 0, psrc = s, pdst = lpre;
|
||||
ccount < lpl;
|
||||
++ccount, ++psrc, ++pdst)
|
||||
{
|
||||
if (*psrc == Meta)
|
||||
{
|
||||
ccount++;
|
||||
*pdst++ = *psrc++;
|
||||
*pdst = *psrc;
|
||||
} else if (*psrc == Dash)
|
||||
*pdst = '-';
|
||||
else
|
||||
*pdst = *psrc;
|
||||
}
|
||||
}
|
||||
else
|
||||
memcpy(lpre, s, lpl);
|
||||
lpre[lpl] = '\0';
|
||||
qlpre = quotename(lpre);
|
||||
lsuf = dupstring(s + offs);
|
||||
|
|
Loading…
Reference in a new issue