CCL: fix regression introduced in YAZ-781
[yaz-moved-to-github.git] / src / cclfind.c
index beec793..c03bdd3 100644 (file)
@@ -439,7 +439,7 @@ static struct ccl_rpn_node *ccl_term_one_use(CCL_parser cclp,
     {
         struct ccl_rpn_attr *attr;
         for (attr = ccl_qual_get_attr(qa[i]); attr; attr = attr->next)
-            if (attr->type != 1 || attr == attr_use)
+            if (attr->type != 1 || !attr_use || attr == attr_use)
             {
                 switch (attr->kind)
                 {
@@ -723,7 +723,7 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
             struct ccl_rpn_attr *attr;
 
             for (attr = ccl_qual_get_attr(qa[i]); attr; attr = attr->next)
-                if (attr->type == 1)
+                if (attr->type == 1 && i == 0)
                 {
                     struct ccl_rpn_node *tmp2;
                     tmp2 = ccl_term_one_use(cclp, cclp->look_token,