1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 06:49:49 +02:00

42164: fix digits in format escapes in completion listings

This commit is contained in:
dana 2017-12-24 16:21:06 -06:00 committed by Peter Stephenson
parent c2cc8b0fbe
commit 1af28cbfd7
3 changed files with 21 additions and 3 deletions

View File

@ -1,5 +1,8 @@
2018-01-04 Peter Stephenson <p.stephenson@samsung.com>
* dana: 42164: Src/Zle/complist.c, Test/Y01completion.ztst:
numeric values didn't work in format escapes in completion lists.
* Stephane: 42159: Src/params.c: avoid crash copying empty hash table.
* Sebastian: 42188: Src/Modules/system.c: It is necessary to

View File

@ -1097,6 +1097,9 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
if (*p) {
int arg = 0, is_fg;
if (idigit(*p))
arg = zstrtol(p, &p, 10);
len = MB_METACHARLENCONV(p, &cchar);
#ifdef MULTIBYTE_SUPPORT
if (cchar == WEOF)
@ -1104,9 +1107,6 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
#endif
p += len;
if (idigit(*p))
arg = zstrtol(p, &p, 10);
m = 0;
switch (cchar) {
case ZWC('%'):

View File

@ -56,6 +56,21 @@
>FI:{file1}
>FI:{file2}
# Temporarily modify format set in comptest
comptesteval 'zstyle -s ":completion:*:descriptions" format oldfmt'
comptesteval 'zstyle ":completion:*:descriptions" format \
${oldfmt/>*</>%5F123abc%f %B123abc%b<}'
comptest $': \t'
comptesteval 'zstyle ":completion:*:descriptions" format $oldfmt'
0:custom description with formatting sequences
>line: {: }{}
*>DESCRIPTION:{*123abc*123abc*~*F123*}
>DI:{dir1}
>DI:{dir2}
>FI:{file1}
>FI:{file2}
F:regression test workers/42164
# Depends on path assignment in comptestinit
comptesteval "path=( $ZTST_srcdir:A )"
comptest $'zt\t'