From b49ed3be8fda533efedec6e6a02543065de9dbfe Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Sun, 1 Apr 2001 08:22:03 +0000 Subject: [PATCH] 2001-04-01 12:20 GMT+3 Alexander Kresin --- harbour/ChangeLog | 4 ++++ harbour/source/rdd/dbfntx/dbfntx1.c | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5c305e5888..83f90b0637 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2001-04-01 12:20 GMT+3 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + * ntxOrderListRebuild() mostly completed + 2001-03-30 14:10 GMT+3 Alexander Kresin * source/rdd/dbfntx/dbfntx1.c ! fixed the bug, reported by John M. S. Chiang, which appeared while diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index 24944a8c6b..2530ea9913 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -998,7 +998,7 @@ static LPPAGEINFO hb_ntxPageNew(LPTAGINFO pParentTag ) pPage->pKeys = ( LPKEYINFO ) hb_xgrab( sizeof( KEYINFO ) * ( pParentTag->MaxKeys + 1 ) ); } memset( pPage->pKeys, 0, sizeof( KEYINFO ) * ( pParentTag->MaxKeys + 1 ) ); - pParentTag->TagBlock = pParentTag->TagBlock + 1024; + pParentTag->TagBlock += 1024; pPage->Page = pParentTag->TagBlock; pPage->CurKey = -1; pPage->lBusy = TRUE; @@ -2215,7 +2215,7 @@ static ERRCODE ntxZap( NTXAREAP pArea ) } pArea->lpCurIndex = lpIndexTmp; hb_xfree( buffer ); - return SUCCESS; + return SELF_GOTOP( ( AREAP ) pArea ); } else return FAILURE; @@ -2654,12 +2654,21 @@ static ERRCODE ntxOrderListRebuild( NTXAREAP pArea ) lpIndex = pArea->lpNtxIndex; lpIndexTmp = pArea->lpCurIndex; + pArea->fValidBuffer = TRUE; while( lpIndex ) { + hb_fsSeek( lpIndex->DiskFile, NTXBLOCKSIZE, FS_SET ); + hb_fsWrite( lpIndex->DiskFile, NULL, 0 ); + hb_ntxIndexCreate( lpIndex ); + + hb_fsSeek( lpIndex->DiskFile , 0 , 0 ); + lpIndex->CompoundTag->TagBlock = + hb_fsSeek( lpIndex->DiskFile, 0, SEEK_END ) - 1024; + lpIndex = lpIndex->pNext; } pArea->lpCurIndex = lpIndexTmp; - return SUCCESS; + return SELF_GOTOP( ( AREAP ) pArea ); } static ERRCODE ntxClose( NTXAREAP pArea )