projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfb2ef5
)
cql2ccl: handle CQL \-sequences differently
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 29 Aug 2011 10:06:18 +0000
(12:06 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 29 Aug 2011 10:06:18 +0000
(12:06 +0200)
For most CQL \-sequences do not produce \-sequence in resulting
CCL term. Only \" and \\ are special
src/cql2ccl.c
patch
|
blob
|
history
diff --git
a/src/cql2ccl.c
b/src/cql2ccl.c
index
ab358f6
..
54b16e7
100644
(file)
--- 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 == '*')
{