From 5b08a03f509d7e3d682bd8044a0281a7dd56495f Mon Sep 17 00:00:00 2001 From: Horacio Dario Roldan Kasimatis Date: Mon, 4 Feb 2002 20:12:56 +0000 Subject: [PATCH] 2002-02-01 08:57 UTC-0300 Horacio Roldan * source/rdd/dbf1.c ! fixed bof bug in hb_dbfGoTo and hb_dbfSkipRaw --- harbour/source/rdd/dbf1.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/harbour/source/rdd/dbf1.c b/harbour/source/rdd/dbf1.c index 8e6b490dc5..3971e4ce82 100644 --- a/harbour/source/rdd/dbf1.c +++ b/harbour/source/rdd/dbf1.c @@ -703,10 +703,11 @@ ERRCODE hb_dbfGoTo( DBFAREAP pArea, ULONG ulRecNo ) else /* Out of space */ { pArea->ulRecNo = pArea->ulRecCount + 1; - if( pArea->ulRecCount == 0 ) + /* pArea->fBof = pArea->fEof = pArea->fValidBuffer = TRUE; */ + if ( pArea->ulRecCount == 0 ) { pArea->fBof = pArea->fEof = pArea->fValidBuffer = TRUE; - } else if(ulRecNo == 0) + } else if (ulRecNo <= 0) { pArea->fBof = pArea->fValidBuffer = TRUE; pArea->fEof = FALSE; @@ -715,7 +716,6 @@ ERRCODE hb_dbfGoTo( DBFAREAP pArea, ULONG ulRecNo ) pArea->fBof = FALSE; pArea->fEof = pArea->fValidBuffer = TRUE; } - pArea->fPositioned = pArea->fDeleted = FALSE; /* Clear buffer */ @@ -826,7 +826,8 @@ ERRCODE hb_dbfSkipRaw( DBFAREAP pArea, LONG lToSkip ) return SUCCESS; } else - return SELF_GOTO( ( AREAP ) pArea, pArea->ulRecNo + lToSkip ); + /* return SELF_GOTO( ( AREAP ) pArea, pArea->ulRecNo + lToSkip ); */ + return SELF_GOTO( ( AREAP ) pArea, ((LONG)pArea->ulRecNo + lToSkip) <= 0 ? 0 : (pArea->ulRecNo + lToSkip)); } /*