提交 f57c0b23 编写于 作者: C Cole Robinson

conf: Convert ParseString to use STRPREFIX

上级 4610a2d5
......@@ -394,17 +394,20 @@ virConfParseString(virConfParserCtxtPtr ctxt)
return NULL;
}
NEXT;
} else if ((ctxt->cur + 6 < ctxt->end) && (ctxt->cur[0] == '"') &&
(ctxt->cur[1] == '"') && (ctxt->cur[2] == '"')) {
} else if ((ctxt->cur + 6 < ctxt->end) &&
(STRPREFIX(ctxt->cur, "\"\"\""))) {
/* String starts with python-style triple quotes """ */
ctxt->cur += 3;
base = ctxt->cur;
while ((ctxt->cur + 2 < ctxt->end) && (ctxt->cur[0] == '"') &&
(ctxt->cur[1] == '"') && (ctxt->cur[2] == '"')) {
if (CUR == '\n') ctxt->line++;
while ((ctxt->cur + 2 < ctxt->end) &&
(STRPREFIX(ctxt->cur, "\"\"\""))) {
if (CUR == '\n')
ctxt->line++;
NEXT;
}
if ((ctxt->cur[0] != '"') || (ctxt->cur[1] != '"') ||
(ctxt->cur[2] != '"')) {
if (!STRPREFIX(ctxt->cur, "\"\"\"")) {
virConfError(ctxt, VIR_ERR_CONF_SYNTAX, _("unterminated string"));
return(NULL);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册