X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zutil%2Fyaz-ccl.c;h=8ed217742167a60a41f436a6101f0be84cf7bc48;hb=1528b5eb5d95e8a0cb788b30af87178ca6534cf9;hp=7da9fbdc0bad17b0128bd1a15d650c8a1c342690;hpb=6c2e6af12b26825488c74a655a40a0cc75a863ca;p=yaz-moved-to-github.git diff --git a/zutil/yaz-ccl.c b/zutil/yaz-ccl.c index 7da9fbd..8ed2177 100644 --- a/zutil/yaz-ccl.c +++ b/zutil/yaz-ccl.c @@ -1,13 +1,14 @@ /* - * Copyright (c) 1996-2002, Index Data. + * Copyright (c) 1996-2003, Index Data. * See the file LICENSE for details. * - * $Id: yaz-ccl.c,v 1.17 2002-12-28 12:16:26 adam Exp $ + * $Id: yaz-ccl.c,v 1.21 2003-06-23 12:38:39 adam Exp $ */ #include #include #include +#include #include #include @@ -116,8 +117,18 @@ void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) wrbuf_puts (w, att->set); wrbuf_puts (w, " "); } - sprintf(tmpattr, "%d=%d ", att->type, att->value); - wrbuf_puts (w, tmpattr); + switch(att->kind) + { + case CCL_RPN_ATTR_NUMERIC: + sprintf(tmpattr, "%d=%d ", att->type, att->value.numeric); + wrbuf_puts (w, tmpattr); + break; + case CCL_RPN_ATTR_STRING: + sprintf(tmpattr, "%d=", att->type); + wrbuf_puts (w, tmpattr); + wrbuf_puts(w, att->value.str); + break; + } } for (cp = p->u.t.term; *cp; cp++) {