From 31c01a577612d38a8ea131f2f9538cec1515fcf6 Mon Sep 17 00:00:00 2001 From: Mindaugas Kavaliauskas Date: Fri, 4 Dec 2009 16:41:49 +0000 Subject: [PATCH] 2009-12-04 18:40 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) * harbour/contrib/rddads/ads1.c ! added comment and workaround to invalid AdsGotoRecord( hTable, 0 ) behavior --- harbour/ChangeLog | 5 +++++ harbour/contrib/rddads/ads1.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 72688d3ef4..33c9911bfd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-04 18:40 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) + * harbour/contrib/rddads/ads1.c + ! added comment and workaround to invalid AdsGotoRecord( hTable, 0 ) + behavior + 2009-12-04 15:55 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) * harbour/src/rdd/dbf1.c ! fixed variable length field setting after DBCREATE() diff --git a/harbour/contrib/rddads/ads1.c b/harbour/contrib/rddads/ads1.c index b7c2044f28..cf6d1eebe7 100644 --- a/harbour/contrib/rddads/ads1.c +++ b/harbour/contrib/rddads/ads1.c @@ -881,7 +881,15 @@ static HB_ERRCODE adsGoTo( ADSAREAP pArea, ULONG ulRecNo ) ulRecNo = 0; u32RetVal = AdsGotoRecord( pArea->hTable, 0 ); } - if( u32RetVal != AE_SUCCESS ) + + /* Usually AdsGotoRecord( *, 0 ) is valid call and returns no error, + * but if previous error was AE_INVALID_RECORD_NUMBER, the following + * AdsGotoRecord( *, 0 ) returns the same error. I'm not sure if this + * AdsGotoRecord( *, 0 ) will position to phantom record and return + * empty fields. I hope I have not made any regressions in code, since + * it replicates previous behaviour. [Mindaugas] + */ + if( u32RetVal != AE_SUCCESS && u32RetVal != AE_INVALID_RECORD_NUMBER ) { commonError( pArea, EG_CORRUPTION, ( HB_ERRCODE ) u32RetVal, 0, NULL, EF_CANDEFAULT, NULL ); return HB_FAILURE;