add escaper \ for command string parsing, example:
virsh # cd /path/which/have/a/double\"quote
Signed-off-by: Lai Jiangshan <laijs(a)cn.fujitsu.com>
---
diff --git a/tools/virsh.c b/tools/virsh.c
index 9fd0602..b96071d 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -10235,7 +10235,11 @@ copy:
if (!double_quote && (*p == ' ' || *p == '\t' || *p ==
';'))
break;
- if (*p == '"') {
+ if (*p == '\\') { /* escape */
+ p++;
+ if (*p == '\0')
+ break;
+ } else if (*p == '"') { /* double quote */
double_quote = !double_quote;
p++;
continue;