From 1a2bd22f51e34404b8bc130a3314ad8e99e2e2d7 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 20 Jun 2011 11:34:03 +0200 Subject: [PATCH] cql2cql: convert mask char '*'=>'?' --- src/cql2ccl.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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++; -- 1.7.10.4