projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ZOOM C uses non-blocking getaddrinfo
[yaz-moved-to-github.git]
/
src
/
rpn2cql.c
diff --git
a/src/rpn2cql.c
b/src/rpn2cql.c
index
c59ca90
..
fb1c6fb
100644
(file)
--- a/
src/rpn2cql.c
+++ b/
src/rpn2cql.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-173,7
+173,7
@@
static Odr_int lookup_truncation(Z_AttributeList *attributes)
}
/* No truncation specified */
return 0;
}
/* No truncation specified */
return 0;
-};
+}
static int rpn2cql_simple(cql_transform_t ct,
void (*pr)(const char *buf, void *client_data),
static int rpn2cql_simple(cql_transform_t ct,
void (*pr)(const char *buf, void *client_data),
@@
-218,10
+218,17
@@
static int rpn2cql_simple(cql_transform_t ct,
if (trunc <= 3 || trunc == 100 || trunc == 102 || trunc == 104)
{
if (trunc <= 3 || trunc == 100 || trunc == 102 || trunc == 104)
{
+ int quote_it = 0;
for (i = 0 ; i < lterm; i++)
if (strchr(" ()=></", sterm[i]))
for (i = 0 ; i < lterm; i++)
if (strchr(" ()=></", sterm[i]))
+ {
+ quote_it = 1;
break;
break;
- wrbuf_puts(w, "\"");
+ }
+ if (lterm == 0)
+ quote_it = 1;
+ if (quote_it)
+ wrbuf_puts(w, "\"");
if (trunc == 2 || trunc == 3)
wrbuf_puts(w, "*");
for (i = 0; i < lterm; i++)
if (trunc == 2 || trunc == 3)
wrbuf_puts(w, "*");
for (i = 0; i < lterm; i++)
@@
-254,7
+261,8
@@
static int rpn2cql_simple(cql_transform_t ct,
}
if (trunc == 1 || trunc == 3)
wrbuf_puts(w, "*");
}
if (trunc == 1 || trunc == 3)
wrbuf_puts(w, "*");
- wrbuf_puts(w, "\"");
+ if (quote_it)
+ wrbuf_puts(w, "\"");
}
else
{
}
else
{