projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4e44d1
)
zebrasrv: sortkeys args are optional
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 26 May 2011 14:22:55 +0000
(16:22 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 26 May 2011 14:22:55 +0000
(16:22 +0200)
index/zebrasrv.c
patch
|
blob
|
history
diff --git
a/index/zebrasrv.c
b/index/zebrasrv.c
index
3a6016f
..
999e915
100644
(file)
--- 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)