From 039c0742c748c6e05611c0bc8a50390a785698ec Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 2 May 2005 09:25:12 +0000 Subject: [PATCH] Attempt to fix bug #305. More scan tests. --- index/zrpn.c | 12 +++++++++++- test/api/t11.c | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/index/zrpn.c b/index/zrpn.c index f53a471..843d68a 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $Id: zrpn.c,v 1.184 2005-04-29 18:56:22 adam Exp $ +/* $Id: zrpn.c,v 1.185 2005-05-02 09:25:12 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -2954,6 +2954,11 @@ ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, { *num_entries -= (after-i); *is_partial = 1; + if (*num_entries < 0) + { + *num_entries = 0; + return ZEBRA_OK; + } } /* consider terms before main term */ for (i = 0; i