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:
bd857a6
)
Fixed bug #678: CQL to PQF translation does not preserve double-quote
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 5 Oct 2006 16:12:23 +0000
(16:12 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 5 Oct 2006 16:12:23 +0000
(16:12 +0000)
escaping.
src/cqltransform.c
patch
|
blob
|
history
diff --git
a/src/cqltransform.c
b/src/cqltransform.c
index
77236b9
..
9cbe7e0
100644
(file)
--- a/
src/cqltransform.c
+++ b/
src/cqltransform.c
@@
-1,4
+1,4
@@
-/* $Id: cqltransform.c,v 1.23 2006-07-05 14:50:16 adam Exp $
+/* $Id: cqltransform.c,v 1.24 2006-10-05 16:12:23 adam Exp $
Copyright (C) 1995-2005, Index Data ApS
Index Data Aps
Copyright (C) 1995-2005, Index Data ApS
Index Data Aps
@@
-444,10
+444,21
@@
void emit_term(cql_transform_t ct,
(*pr)("\"", client_data);
for (i = 0; i<length; i++)
{
(*pr)("\"", client_data);
for (i = 0; i<length; i++)
{
- char buf[2];
- buf[0] = term[i];
- buf[1] = 0;
- (*pr)(buf, client_data);
+ /* pr(int) each character */
+ char buf[3];
+ const char *cp;
+
+ buf[1] = term[i];
+ buf[2] = 0;
+ /* do we have to escape this char? */
+ if (buf[1] == '"')
+ {
+ buf[0] = '\\';
+ cp = buf;
+ }
+ else
+ cp = buf+1;
+ (*pr)(cp, client_data);
}
(*pr)("\" ", client_data);
}
}
(*pr)("\" ", client_data);
}