X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/7b00c0c43f52e9d27168e67a26aac19065cdb40c..ad3c9f2af814c84582fdd1649e49ec4f68572c5a:/db/btree/FreeBSD/bt_seq.c diff --git a/db/btree/FreeBSD/bt_seq.c b/db/btree/FreeBSD/bt_seq.c index 2ffe71f..b0b8b04 100644 --- a/db/btree/FreeBSD/bt_seq.c +++ b/db/btree/FreeBSD/bt_seq.c @@ -369,18 +369,19 @@ __bt_first(BTREE *t, const DBT *key, EPG *erval, int *exactp) * occurs. */ if (ep->index == 0) { + PAGE *hprev; if (h->prevpg == P_INVALID) break; if (h->pgno != save.page->pgno) mpool_put(t->bt_mp, h, 0); - if ((h = mpool_get(t->bt_mp, + if ((hprev = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL) { if (h->pgno == save.page->pgno) mpool_put(t->bt_mp, save.page, 0); return (RET_ERROR); } - ep->page = h; + ep->page = h = hprev; ep->index = NEXTINDEX(h); } --ep->index;