1
0
Fork 0
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:
Bart Schaefer 2001-05-06 22:37:51 +00:00
parent d58c1780fd
commit 5aa1c04fd6

View file

@ -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;