diff --git a/ChangeLog b/ChangeLog index d6e645ad..b1345721 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 14 17:00:08 CET 2003 Daniel Veillard + + * xpath.c: Alexey Efimov pointed out that concat('a', 'b', ) + should raise a syntax error + Tue Jan 14 15:39:14 CET 2003 Daniel Veillard * python/libxml.c: cleanup patch from Stéphane Bidoul diff --git a/xpath.c b/xpath.c index 22353bab..86163f1b 100644 --- a/xpath.c +++ b/xpath.c @@ -7617,19 +7617,21 @@ xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) { SKIP_BLANKS; ctxt->comp->last = -1; - while (CUR != ')') { - int op1 = ctxt->comp->last; - ctxt->comp->last = -1; - xmlXPathCompileExpr(ctxt); - CHECK_ERROR; - PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0); - nbargs++; - if (CUR == ')') break; - if (CUR != ',') { - XP_ERROR(XPATH_EXPR_ERROR); + if (CUR != ')') { + while (CUR != 0) { + int op1 = ctxt->comp->last; + ctxt->comp->last = -1; + xmlXPathCompileExpr(ctxt); + CHECK_ERROR; + PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0); + nbargs++; + if (CUR == ')') break; + if (CUR != ',') { + XP_ERROR(XPATH_EXPR_ERROR); + } + NEXT; + SKIP_BLANKS; } - NEXT; - SKIP_BLANKS; } PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix);