From: Adam Dickmeiss Date: Fri, 17 Aug 2007 12:25:26 +0000 (+0000) Subject: Fixed bug #1355: CCL-queries messed up by binary chars. X-Git-Tag: PAZPAR2.1.0.2~2 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=32b629e24724670d2cfb71c1db1e5a26fc5ae399;p=pazpar2-moved-to-github.git Fixed bug #1355: CCL-queries messed up by binary chars. Apparently the yaz_iconv_open was passed an empty string - returned from absent queryencoding setting. We now check for empty string.. I don't like empty string and NULL value to be messed. Function session_setting_oneval should return NULL for absent value. Empty string for empty string. --- diff --git a/src/client.c b/src/client.c index a88f6b5..7b82c69 100644 --- a/src/client.c +++ b/src/client.c @@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.16 2007-07-13 13:16:57 adam Exp $ +/* $Id: client.c,v 1.17 2007-08-17 12:25:26 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -404,8 +404,7 @@ void client_send_search(struct client *cl) Z_Query *zquery; int ssub = 0, lslb = 100000, mspn = 10; char *piggyback = 0; - char *queryenc = 0; - yaz_iconv_t iconv = 0; + char *queryenc = session_setting_oneval(sdb, PZ_QUERYENCODING); yaz_log(YLOG_DEBUG, "Sending search to %s", sdb->database->url); @@ -418,8 +417,9 @@ void client_send_search(struct client *cl) client_get_pquery(cl)); // converting to target encoding - if ((queryenc = session_setting_oneval(sdb, PZ_QUERYENCODING))){ - iconv = yaz_iconv_open(queryenc, "UTF-8"); + if (queryenc && *queryenc) + { + yaz_iconv_t iconv = yaz_iconv_open(queryenc, "UTF-8"); if (iconv){ yaz_query_charset_convert_rpnquery(zquery->u.type_1, global_parameters.odr_out, @@ -925,6 +925,7 @@ int client_parse_query(struct client *cl, const char *query) if (!ccl_map) return -1; + cn = ccl_find_str(ccl_map, query, &cerror, &cpos); ccl_qual_rm(&ccl_map); if (!cn)