X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=zutil%2Fyaz-ccl.c;h=d1ab287cc38eb9485cf0f2a73f5ff7506700a296;hp=f4033e1e8428e422c236fe1d3217b677d4eb4e47;hb=c1957f49e5f8c37c06ed839cde52d60108bc2e35;hpb=15233cfdc4c7610b634b8a8643ed1609c386bcc8 diff --git a/zutil/yaz-ccl.c b/zutil/yaz-ccl.c index f4033e1..d1ab287 100644 --- a/zutil/yaz-ccl.c +++ b/zutil/yaz-ccl.c @@ -1,10 +1,12 @@ /* * Copyright (c) 1996-2001, Index Data. * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-ccl.c,v $ - * Revision 1.12 2001-03-07 13:24:40 adam + * Revision 1.13 2001-05-09 23:31:35 adam + * String attribute values for PQF. Proper C-backslash escaping for PQF. + * + * Revision 1.12 2001/03/07 13:24:40 adam * Member and_not in Z_Operator is kept for backwards compatibility. * Added support for definition of CCL operators in field spec file. * @@ -300,6 +302,7 @@ static void ccl_pquery_complex (WRBUF w, struct ccl_rpn_node *p) void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) { struct ccl_rpn_attr *att; + const char *cp; switch (p->kind) { @@ -327,9 +330,13 @@ void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) sprintf(tmpattr, "%d=%d ", att->type, att->value); wrbuf_puts (w, tmpattr); } - wrbuf_puts (w, "{"); - wrbuf_puts (w, p->u.t.term); - wrbuf_puts (w, "} "); + for (cp = p->u.t.term; *cp; cp++) + { + if (*cp == ' ' || *cp == '\\') + wrbuf_putc (w, '\\'); + wrbuf_putc (w, *cp); + } + wrbuf_puts (w, " "); break; } }