mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-31 03:04:49 +01:00
Prevent "no multi-letter values" error on values of '\:' and '' in compvalues().
This commit is contained in:
parent
d58c1780fd
commit
5aa1c04fd6
1 changed files with 3 additions and 2 deletions
|
@ -2119,6 +2119,7 @@ parse_cvdef(char *nam, char **args)
|
|||
ret->lastt = time(0);
|
||||
|
||||
for (valp = &(ret->vals); *args; args++) {
|
||||
int bs = 0;
|
||||
p = dupstring(*args);
|
||||
xnum = 0;
|
||||
|
||||
|
@ -2166,9 +2167,9 @@ parse_cvdef(char *nam, char **args)
|
|||
|
||||
for (name = p; *p && *p != ':' && *p != '['; p++)
|
||||
if (*p == '\\' && p[1])
|
||||
p++;
|
||||
p++, bs = 1;
|
||||
|
||||
if (hassep && !sep && name + 1 != p) {
|
||||
if (hassep && !sep && name + bs + 1 < p) {
|
||||
freecvdef(ret);
|
||||
zwarnnam(nam, "no multi-letter values with empty separator allowed", NULL, 0);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue