diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b2d5aab676..3fdd1c0649 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2003-02-12 11:15 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + * source/rdd/dbf1.c + ! Bug fixed: APPEND FROM gave an error if the file was opened already + 2003-02-12 10:00 UTC+0300 Alexander Kresin + source/codepage/cdpgedos.c + German dos codepage, provided by Guenther Steiner diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index 9f030f19c7..b0fad67979 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -3569,8 +3569,8 @@ static LPAREANODE GetTheOtherArea( char *szDriver, char * szFileName, BOOL creat pInfo.abName = (BYTE *) szDbfName; strcpy( ( char * ) pInfo.abName, szFileName ); pInfo.atomAlias = ( BYTE * ) "__TMPAREA"; - pInfo.fShared = FALSE; - pInfo.fReadonly = FALSE; + pInfo.fShared = (createIt)? FALSE : !hb_set.HB_SET_EXCLUSIVE; + pInfo.fReadonly = (createIt)? FALSE : TRUE; /* get the new area node */ pAreaNode = hb_rddNewAreaNode( pRDDNode, uiRddID ); @@ -3673,7 +3673,10 @@ static LPAREANODE GetTheOtherArea( char *szDriver, char * szFileName, BOOL creat SELF_RELEASE( ( AREAP ) pAreaNode->pArea ); hb_xfree( pInfo.abName ); hb_xfree( pAreaNode ); - hb_errRT_DBCMD( EG_OPEN, 0, NULL, "DBAPP" ); // Could not open it + if( createIt ) + hb_errRT_DBCMD( EG_OPEN, 0, NULL, "DBAPP" ); // Could not open it + else + s_bNetError = TRUE; /* Temp fix! What about other types of errors? */ return NULL; } hb_xfree( szDbfName ); @@ -3756,7 +3759,11 @@ static ERRCODE rddMoveRecords( char *cAreaFrom, char *cAreaTo, PHB_ITEM pFields, if ( cAreaFrom ) /*it's an APPEND FROM*/ { /*make it current*/ - pAreaRelease = s_pCurrArea = GetTheOtherArea( szDriver, cAreaFrom, FALSE, NULL ); + pAreaRelease = GetTheOtherArea( szDriver, cAreaFrom, FALSE, NULL ); + if( pAreaRelease ) + s_pCurrArea = pAreaRelease; + else + return FAILURE; pAreaFrom = (AREAP) pAreaRelease->pArea; } else diff --git a/harbour/source/rdd/dbf1.c b/harbour/source/rdd/dbf1.c index 9fd56dd806..8bc8375e6a 100644 --- a/harbour/source/rdd/dbf1.c +++ b/harbour/source/rdd/dbf1.c @@ -1739,6 +1739,7 @@ ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) if( ( ( PHB_DYNS ) pArea->atomAlias )->hArea ) { hb_errRT_DBCMD( EG_DUPALIAS, EDBCMD_DUPALIAS, NULL, ( char * ) pOpenInfo->atomAlias ); + hb_xfree( pArea->szDataFileName ); return FAILURE; } @@ -1793,7 +1794,10 @@ ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) /* Exit if error */ if( pArea->hDataFile == FS_ERROR ) + { + hb_xfree( pArea->szDataFileName ); return FAILURE; + } /* Read file header and exit if error */ if( SELF_READDBHEADER( ( AREAP ) pArea ) == FAILURE )