]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: allow zero length arguments
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 12 Oct 2010 07:13:28 +0000 (15:13 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 13 Oct 2010 13:52:32 +0000 (07:52 -0600)
the following command is allowed at shell, we also make it allowed at virsh shell.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
tools/virsh.c

index c79ac23503fa048333546d802d07be51cc6e1a4f..65f26df2ffaed28adb4dfd33e6349a7b9d26132a 100644 (file)
@@ -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;