libidav/davqlparser.c

changeset 359
bacb54502b24
parent 358
54dbd44ac6b0
child 365
f04ab0420512
--- a/libidav/davqlparser.c	Thu Dec 21 19:42:25 2017 +0100
+++ b/libidav/davqlparser.c	Thu Dec 21 19:48:27 2017 +0100
@@ -1613,6 +1613,11 @@
         tokens = tokens->next;
         tokens = ucx_list_get(tokens,
             dav_parse_where_clause(stmt, tokens));
+    } else if (token_is(tokens, DAVQL_TOKEN_KEYWORD)
+            && tokenvalue_is(tokens, "anywhere")) {
+        // useless, but the user may want to explicitly express his intent
+        tokens = tokens->next;
+        stmt->where = NULL;
     }
     if (stmt->errorcode) {
         return;
@@ -1694,10 +1699,12 @@
     } else if (token_is(tokens, DAVQL_TOKEN_KEYWORD)
             && tokenvalue_is(tokens, "anywhere")) {
         // no-op, but we want the user to be explicit about this
+        tokens = tokens->next;
         stmt->where = NULL;
     } else {
         dav_error_in_context(DAVQL_ERROR_MISSING_TOKEN,
                 _error_missing_where, stmt, tokens);
+        return;
     }
 }
 

mercurial