From: Adam Dickmeiss Date: Thu, 26 May 2011 14:22:55 +0000 (+0200) Subject: zebrasrv: sortkeys args are optional X-Git-Tag: v2.0.48~7 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=5d536c8cf5400b1e4da91061cf736a9ab53e5bd1;p=idzebra-moved-to-github.git zebrasrv: sortkeys args are optional --- diff --git a/index/zebrasrv.c b/index/zebrasrv.c index 3a6016f..999e915 100644 --- a/index/zebrasrv.c +++ b/index/zebrasrv.c @@ -298,13 +298,13 @@ static Z_RPNQuery *query_add_sortkeys(ODR o, Z_RPNQuery *query, int ascending = 1; nmem_strsplitx(odr_getmem(o), ",", sortspec[i], &arg, &num_arg, 0); - if (num_arg != 5) + if (num_arg > 5 || num_arg < 1) { yaz_log(YLOG_WARN, "Invalid sort spec '%s' num_arg=%d", sortspec[i], num_arg); break; } - if (arg[2][0]) + if (num_arg > 2 && arg[2][0]) ascending = atoi(arg[2]); if (i < num_sortspec-1)