X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fcql2ccl.c;h=331b6dbfc14e23bba0664bed14681e595d118023;hb=b9e057ce1b31f4cef4364de7c36b5c119cc94cc3;hp=81e2c5ff0e5b5bb73e4442b936a378abcbc3a5d6;hpb=0c46d2e66bdeea1600e700124a81a5d0a65d349e;p=yaz-moved-to-github.git diff --git a/src/cql2ccl.c b/src/cql2ccl.c index 81e2c5f..331b6db 100644 --- a/src/cql2ccl.c +++ b/src/cql2ccl.c @@ -91,6 +91,7 @@ static int node(struct cql_node *cn, const char *split_op = 0; const char *ccl_rel = 0; const char *rel = cn->u.st.relation; + const char *cp; if (cn->u.st.index && strcmp(cn->u.st.index, "cql.serverChoice")) @@ -121,38 +122,26 @@ static int node(struct cql_node *cn, /* unsupported relation */ return -1; } - for (; cn; cn = cn->u.st.extra_terms) + cp = cn->u.st.term; + while (1) { - const char *cp = cn->u.st.term; - while (1) + if (ccl_field && ccl_rel) { - if (ccl_field && ccl_rel) - { - pr(ccl_field, client_data); - pr(ccl_rel, client_data); - if (!split_op) - ccl_rel = 0; - } - pr_term(&cp, split_op ? 1 : 0, pr, client_data); - while (*cp == ' ') - cp++; - if (*cp == '\0') - break; - pr(" ", client_data); - if (split_op) - { - pr(split_op, client_data); - pr(" ", client_data); - } + pr(ccl_field, client_data); + pr(ccl_rel, client_data); + if (!split_op) + ccl_rel = 0; } - if (cn->u.st.extra_terms) + pr_term(&cp, split_op ? 1 : 0, pr, client_data); + while (*cp == ' ') + cp++; + if (*cp == '\0') + break; + pr(" ", client_data); + if (split_op) { + pr(split_op, client_data); pr(" ", client_data); - if (split_op) - { - pr(split_op, client_data); - pr(" ", client_data); - } } } return 0;