From: Adam Dickmeiss Date: Mon, 20 Jun 2011 09:34:03 +0000 (+0200) Subject: cql2cql: convert mask char '*'=>'?' X-Git-Tag: v4.2.4~3 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=1a2bd22f51e34404b8bc130a3314ad8e99e2e2d7;p=yaz-moved-to-github.git cql2cql: convert mask char '*'=>'?' --- diff --git a/src/cql2ccl.c b/src/cql2ccl.c index 48bb284..f427e7c 100644 --- a/src/cql2ccl.c +++ b/src/cql2ccl.c @@ -26,9 +26,19 @@ static void pr_term(struct cql_node *cn, { while (cn) { - pr("\"", client_data); - pr(cn->u.st.term, client_data); - pr("\"", client_data); + const char *cp; + cp = cn->u.st.term; + while (*cp) + { + char x[2]; + if (*cp == '*') + x[0] = '?'; + else + x[0] = *cp; + x[1] = 0; + pr(x, client_data); + cp++; + } if (cn->u.st.extra_terms) pr(" ", client_data); cn = cn->u.st.extra_terms; @@ -98,7 +108,10 @@ static int node(struct cql_node *cn, while (*cp && *cp != ' ') { char x[2]; - x[0] = *cp; + if (*cp == '*') + x[0] = '?'; + else + x[0] = *cp; x[1] = '\0'; pr(x, client_data); cp++;