提交 94f776e7 编写于 作者: G Guido Günther

virBufferEscapeShell: Fix escaping of single quotes.

When checking if we need to escape a single quote we were looking at the
character after the quote instead of at the quote itself.
上级 de12bee7
......@@ -524,13 +524,13 @@ virBufferEscapeShell(virBufferPtr buf, const char *str)
*out++ = '\'';
while (*cur != 0) {
*out++ = *cur++;
if (*cur == '\'') {
*out++ = '\'';
/* Replace literal ' with a close ', a \', and a open ' */
*out++ = '\\';
*out++ = '\'';
*out++ = '\'';
}
*out++ = *cur++;
}
*out++ = '\'';
*out = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册