From: Adam Dickmeiss Date: Mon, 29 Aug 2011 10:06:18 +0000 (+0200) Subject: cql2ccl: handle CQL \-sequences differently X-Git-Tag: v4.2.13~10 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=fda1ca39e89e4c7f3479c0a9d2a1e38acfdb46bb;p=yaz-moved-to-github.git cql2ccl: handle CQL \-sequences differently For most CQL \-sequences do not produce \-sequence in resulting CCL term. Only \" and \\ are special --- diff --git a/src/cql2ccl.c b/src/cql2ccl.c index ab358f6..54b16e7 100644 --- a/src/cql2ccl.c +++ b/src/cql2ccl.c @@ -38,11 +38,20 @@ static void pr_term(struct cql_node *cn, if (*cp == '\\' && cp[1]) { - x[0] = cp[0]; - x[1] = cp[1]; - x[2] = '\0'; + if (!quote_mode) + { + pr("\"", client_data); + quote_mode = 1; + } cp++; - pr(x, client_data); + if (*cp == '\"' || *cp == '\\') + pr("\\\"", client_data); + else + { + x[0] = *cp; + x[1] = '\0'; + pr(x, client_data); + } } else if (*cp == '*') {