X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcclptree.c;h=98e6bb8891312b34c8de8b45d405a73c503cc85d;hp=55d8ef8455adfd4ff025bb2bbc46f4d624827552;hb=a5795a2df2095d5a44b012a59426e7b906db3ec9;hpb=ee6ab2ee3a9ee1a8c65d7272ec7fba1d886f5af0 diff --git a/src/cclptree.c b/src/cclptree.c index 55d8ef8..98e6bb8 100644 --- a/src/cclptree.c +++ b/src/cclptree.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. */ /** @@ -14,6 +14,7 @@ #include #include +#include #include static void ccl_pquery_indent(WRBUF w, struct ccl_rpn_node *p, int indent); @@ -68,19 +69,7 @@ static void ccl_pquery_complex(WRBUF w, struct ccl_rpn_node *p, int indent) static void ccl_prterm(WRBUF w, const char *term) { - if (!*term) - wrbuf_puts(w, "\"\""); - else - { - const char *cp = term; - for (; *cp; cp++) - { - if (*cp == ' ' || *cp == '\\') - wrbuf_putc(w, '\\'); - wrbuf_putc(w, *cp); - } - } - wrbuf_puts(w, " "); + yaz_encode_pqf_term(w, term, strlen(term)); } static void ccl_pquery_indent(WRBUF w, struct ccl_rpn_node *p, int indent) @@ -158,6 +147,7 @@ void ccl_pr_tree(struct ccl_rpn_node *rpn, FILE *fd_out) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab