X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fzebrasrv.c;h=7ef4cd2c5717a44fbe46def0c470980354d32535;hp=75fabaa36517d05e0a6cbfc285c5ebd9d4a553d2;hb=dedcb702edbaed5026f1f98964ca68edcfd3cfc2;hpb=588d7613f34b985a1753cc96ca3d3c9c3af3a9f0 diff --git a/index/zebrasrv.c b/index/zebrasrv.c index 75fabaa..7ef4cd2 100644 --- a/index/zebrasrv.c +++ b/index/zebrasrv.c @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -274,10 +277,11 @@ static Z_RPNQuery *query_add_sortkeys(ODR o, Z_RPNQuery *query, /* sortkey layour: path,schema,ascending,caseSensitive,missingValue */ /* see cql_sortby_to_sortkeys of YAZ. */ char **sortspec; - int num_sortspec; + int num_sortspec = 0; int i; - nmem_strsplit_blank(odr_getmem(o), sortKeys, &sortspec, &num_sortspec); + if (sortKeys) + nmem_strsplit_blank(odr_getmem(o), sortKeys, &sortspec, &num_sortspec); if (num_sortspec > 0) { Z_RPNQuery *nquery;