X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=rset%2Frset.c;h=cdcc76e58e0807928699787862933a39595bcba5;hb=2a0be28b861bf340b8213ad17438daf49e5cb8b0;hp=780727a12fb0286768d4b8825908299e93a9e257;hpb=9d5bfe73fd06d99c306f91860a322aece5b6f4fc;p=idzebra-moved-to-github.git diff --git a/rset/rset.c b/rset/rset.c index 780727a..cdcc76e 100644 --- a/rset/rset.c +++ b/rset/rset.c @@ -1,5 +1,5 @@ -/* $Id: rset.c,v 1.54 2006-06-22 22:58:59 adam Exp $ - Copyright (C) 1995-2005 +/* $Id: rset.c,v 1.56 2006-08-16 13:14:45 adam Exp $ + Copyright (C) 1995-2006 Index Data ApS This file is part of the Zebra server. @@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #include @@ -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++;