CCL: allow quoted terms for date ranges YAZ-681
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 18 Sep 2013 09:27:20 +0000 (11:27 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 18 Sep 2013 09:27:20 +0000 (11:27 +0200)
src/cclfind.c

index aa4b303..8a74f5b 100644 (file)
@@ -687,9 +687,14 @@ struct ccl_rpn_node *qualifiers_order(CCL_parser cclp,
         if (KIND == CCL_TOK_TERM)
         {
             size_t i;
+            int quote_mode = 0;
             for (i = 0; i<cclp->look_token->len; i++)
             {
-                if (cclp->look_token->name[i] == '-')
+                if (i > 0 && cclp->look_token->name[i] == '\\')
+                    ;
+                else if (cclp->look_token->name[i] == '"')
+                    quote_mode = !quote_mode;
+                else if (cclp->look_token->name[i] == '-' && !quote_mode)
                     break;
             }