
12 Oct
2010
12 Oct
'10
9:14 a.m.
add escaper \ for command string parsing, example: virsh # cd /path/which/have/a/double\"quote Signed-off-by: Lai Jiangshan <laijs@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;