diff -r 46971430650b -r 838b427267bb libidav/davqlparser.c --- a/libidav/davqlparser.c Sat Apr 04 22:06:42 2015 +0200 +++ b/libidav/davqlparser.c Sat Apr 04 22:20:39 2015 +0200 @@ -251,6 +251,7 @@ #define _unknown_attribute "unknown attribute '%.*s'" #define _duplicated_attribute "duplicated attribute '%.*s'" #define _invalid_depth "invalid depth" +#define _identifier_expected "identifier expected, but found: %.*s" static UcxList* dav_parse_tokenize(sstr_t src) { UcxList *tokens = NULL; @@ -422,7 +423,7 @@ /* * 1: depth */ - int key = 0; + static int key = 0; static int keymask = 0; switch (parsestate) { @@ -565,7 +566,13 @@ case 20: { DavQLExpression *expr = dav_parse_expression(stmt, token, 1); stmt->path = expr->srctext; + int exprtype = expr->type; dav_free_expression(expr); + if (exprtype != DAVQL_IDENTIFIER) { + stmt->errorcode = DAVQL_ERROR_IDENTIFIER_EXPECTED; + stmt->errormessage = ucx_sprintf(_identifier_expected, + sfmtarg(tokendata)).ptr; + } step = 530; break; }