[PATCH 2/8] virsh: allow zero length arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the following command is allowed at shell, we also make it allowed at virsh shel.
# somecmd ""

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
diff --git a/tools/virsh.c b/tools/virsh.c
index 7b6f2b6..1e95023 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -10175,7 +10175,6 @@ vshCommandGetToken(vshControl *ctl, char *str, char **end, char **res)
     bool double_quote = false;
     int sz = 0;
     char *p = str, *q;
-    char *tkstr = NULL;
 
     *end = NULL;
 
@@ -10211,7 +10210,6 @@ copy:
             } else {
                 tk = VSH_TK_DATA;
             }
-            tkstr = p;          /* begin of token */
         }
 
 	if (*p == '"') {
@@ -10229,10 +10227,6 @@ copy:
         vshError(ctl, "%s", _("missing \""));
         return VSH_TK_ERROR;
     }
-    if (tkstr == NULL || *tkstr == '\0' || p == NULL)
-        return VSH_TK_END;
-    if (sz == 0)
-        return VSH_TK_END;
 
     if (!*res) {
         *res = vshMalloc(ctl, sz + 1);

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]