mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
virsh: allow zero length arguments
the following command is allowed at shell, we also make it allowed at virsh shell. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
This commit is contained in:
parent
d9adac3e76
commit
cdfe543fc8
@ -10339,7 +10339,6 @@ vshCommandGetToken(vshControl *ctl, char *str, char **end, char **res)
|
||||
int sz = 0;
|
||||
char *p = str;
|
||||
char *q = vshStrdup(ctl, str);
|
||||
char *tkstr = NULL;
|
||||
|
||||
*end = NULL;
|
||||
*res = q;
|
||||
@ -10373,7 +10372,6 @@ vshCommandGetToken(vshControl *ctl, char *str, char **end, char **res)
|
||||
} else {
|
||||
tk = VSH_TK_DATA;
|
||||
}
|
||||
tkstr = p; /* begin of token */
|
||||
}
|
||||
|
||||
if (*p == '"') {
|
||||
@ -10389,8 +10387,6 @@ vshCommandGetToken(vshControl *ctl, char *str, char **end, char **res)
|
||||
vshError(ctl, "%s", _("missing \""));
|
||||
return VSH_TK_ERROR;
|
||||
}
|
||||
if (tkstr == NULL || *tkstr == '\0' || sz == 0)
|
||||
return VSH_TK_END;
|
||||
|
||||
*q = '\0';
|
||||
*end = p;
|
||||
|
Loading…
Reference in New Issue
Block a user