diff --git a/ChangeLog b/ChangeLog index 4a39f66a..dcddad42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Apr 22 10:49:23 CEST 2001 Daniel Veillard + + * xpath.c: fixed xmlXPathCompile to detected unproperly ended expr + Sat Apr 21 18:27:51 CEST 2001 Bjorn Reese * libxml.h: new header used only for the compilation of libxml diff --git a/xpath.c b/xpath.c index f170917d..c887e561 100644 --- a/xpath.c +++ b/xpath.c @@ -7433,8 +7433,13 @@ xmlXPathCompile(const xmlChar *str) { ctxt = xmlXPathNewParserContext(str, NULL); xmlXPathCompileExpr(ctxt); - comp = ctxt->comp; - ctxt->comp = NULL; + if (*ctxt->cur != 0) { + xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_EXPR_ERROR); + comp = NULL; + } else { + comp = ctxt->comp; + ctxt->comp = NULL; + } xmlXPathFreeParserContext(ctxt); return(comp); }