From fda1ca39e89e4c7f3479c0a9d2a1e38acfdb46bb Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 29 Aug 2011 12:06:18 +0200 Subject: [PATCH] cql2ccl: handle CQL \-sequences differently For most CQL \-sequences do not produce \-sequence in resulting CCL term. Only \" and \\ are special --- src/cql2ccl.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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 == '*') { -- 1.7.10.4