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 (from parent 1:
2e1d346
)
Escaping :
author
Dennis Schafroth
<dennis@indexdata.com>
Mon, 11 Jul 2011 11:36:38 +0000
(13:36 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Mon, 11 Jul 2011 11:36:38 +0000
(13:36 +0200)
src/rpn2solr.c
patch
|
blob
|
history
diff --git
a/src/rpn2solr.c
b/src/rpn2solr.c
index
89b8b91
..
11abe87
100644
(file)
--- a/
src/rpn2solr.c
+++ b/
src/rpn2solr.c
@@
-245,6
+245,7
@@
static int rpn2solr_simple(solr_transform_t ct,
{
size_t i;
int must_quote = 0;
{
size_t i;
int must_quote = 0;
+
for (i = 0 ; i < lterm; i++)
if (sterm[i] == ' ')
must_quote = 1;
for (i = 0 ; i < lterm; i++)
if (sterm[i] == ' ')
must_quote = 1;
@@
-253,7
+254,13
@@
static int rpn2solr_simple(solr_transform_t ct,
/* Bug 2878: Check and add Truncation */
if (checkForLeftTruncation(apt->attributes))
wrbuf_puts(w, "*");
/* Bug 2878: Check and add Truncation */
if (checkForLeftTruncation(apt->attributes))
wrbuf_puts(w, "*");
- wrbuf_write(w, sterm, lterm);
+ /* BUG 4415: Escape : (as \:) in string terms */
+ for (i = 0 ; i < lterm; i++) {
+ if (sterm[i] == ':') {
+ wrbuf_putc(w, '\\');
+ }
+ wrbuf_putc(w, sterm[i]);
+ }
/* Bug 2878: Check and add Truncation */
if (checkForRightTruncation(apt->attributes))
wrbuf_puts(w, "*");
/* Bug 2878: Check and add Truncation */
if (checkForRightTruncation(apt->attributes))
wrbuf_puts(w, "*");