From 6c44badd16954990c79227f5d698c0e7c8c15e2a Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Thu, 17 May 2001 09:25:05 +0000 Subject: [PATCH] 2001-05-17 13:25 GMT+3 Alexander Kresin --- harbour/ChangeLog | 5 +++++ harbour/source/rdd/dbfntx/dbfntx1.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c325b0104f..49f4e31503 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +2001-05-17 13:25 GMT+3 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + * bugs fixed, reported by John M. S. Chiang, related to appending of + new records + 2001-05-16 22:50 GMT+3 Alexander Kresin * source/rdd/dbfntx/dbfntx1.c * bugs fixed, reported by John M. S. Chiang, related to seek with diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index 6fc63363d4..3e2a64e2c2 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -1269,7 +1269,9 @@ static int hb_ntxPageKeyAdd( LPPAGEINFO pPage, PHB_ITEM pKey, int level, BOOL is /* printf( "\nntxPageKeyAdd - 0 ( %d / %d )",level,pPage->TagParent->uiPages ); */ if( pPage->uiKeys == 0 ) { - pPage->uiKeys=1; + if( pPage->TagParent->Owner->NextAvail == pPage->Page ) + pPage->TagParent->Owner->NextAvail = 0; + pPage->uiKeys = 1; pPage->Changed = TRUE; pPage->pKeys->Xtra = pPage->TagParent->Owner->Owner->ulRecNo; pPage->pKeys->pItem = hb_itemNew( pKey ); @@ -2068,13 +2070,12 @@ static ERRCODE ntxSeek( NTXAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFin return SELF_GOTO( ( AREAP ) pArea, lRecno ); } else - { + { lpCurIndex = pArea->lpCurIndex; pArea->lpCurIndex = NULL; SELF_GOBOTTOM( ( AREAP ) pArea ); retvalue = SELF_SKIPRAW( ( AREAP ) pArea, 1 ); pArea->lpCurIndex = lpCurIndex; - pArea->fBof = FALSE; return retvalue; } } @@ -2772,6 +2773,8 @@ static ERRCODE ntxClose( NTXAREAP pArea ) { HB_TRACE(HB_TR_DEBUG, ("ntxClose(%p)", pArea)); + if( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE ) + return FAILURE; ntxOrderListClear( pArea ); return SUPER_CLOSE( ( AREAP ) pArea ); }