X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=rset%2Frset.c;h=e6cb176e37f2079bf5b274e16b83ed35a03aad9b;hp=1424692afdbc13224f177cc7d7c4f5fd960d32b3;hb=89d3a004b7c651fd5673abfc192e1472dc4d4197;hpb=4478d785b7769691261005c98063b98a5a5971b3 diff --git a/rset/rset.c b/rset/rset.c index 1424692..e6cb176 100644 --- a/rset/rset.c +++ b/rset/rset.c @@ -1,5 +1,5 @@ -/* $Id: rset.c,v 1.55 2006-08-14 10:40:21 adam Exp $ - Copyright (C) 1995-2006 +/* $Id: rset.c,v 1.57 2007-01-15 15:10:19 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -358,8 +358,17 @@ int rset_default_read(RSFD rfd, void *buf, TERMID *term) int rc = (*rset->control->f_read)(rfd, buf, term); if (rc > 0) { - if (rfd->counted_items == 0 || - (rset->keycontrol->cmp)(buf, rfd->counted_buf) > rset->scope) + int got_scope; + if (rfd->counted_items == 0) + got_scope = rset->scope+1; + else + got_scope = rset->keycontrol->cmp(buf, rfd->counted_buf); + +#if 0 + key_logdump_txt(YLOG_LOG, buf, "rset_default_read"); + yaz_log(YLOG_LOG, "rset_scope=%d got_scope=%d", rset->scope, got_scope); +#endif + if (got_scope > rset->scope) { memcpy(rfd->counted_buf, buf, rset->keycontrol->key_size); rfd->counted_items++;