diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ca73551ff8..f4b83e4f66 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,14 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-21 16:28 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) + * harbour/contrib/hbwin/axcore.c + * return NIL instead of runtime error if failed to obtain + connection point + ; Please test + * harbour/src/rtl/fscopy.c + * added error check for read operation + 2011-02-21 13:59 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/filesys.c + fs_win_set_drive(): Setting SEM_FAILCRITICALERRORS before diff --git a/harbour/contrib/hbwin/axcore.c b/harbour/contrib/hbwin/axcore.c index 694a68607c..a2bd242a42 100644 --- a/harbour/contrib/hbwin/axcore.c +++ b/harbour/contrib/hbwin/axcore.c @@ -673,9 +673,9 @@ HB_FUNC( __AXREGISTERHANDLER ) /* ( pDisp, bHandler [, cIID] ) --> pSink */ hb_oleSetError( lOleError ); if( lOleError != S_OK ) - hb_errRT_OLE( EG_ARG, 1014, ( HB_ERRCODE ) lOleError, "Failed to obtain connection point", HB_ERR_FUNCNAME ); + hb_ret(); } else - hb_errRT_OLE( EG_ARG, 1015, 0, "Failed to obtain connection point", HB_ERR_FUNCNAME ); + hb_errRT_OLE( EG_ARG, 1015, 0, NULL, HB_ERR_FUNCNAME ); } } diff --git a/harbour/src/rtl/fscopy.c b/harbour/src/rtl/fscopy.c index b86cdf6a6d..e88b791ec6 100644 --- a/harbour/src/rtl/fscopy.c +++ b/harbour/src/rtl/fscopy.c @@ -62,8 +62,8 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) { - HB_ERRCODE errCode = 0; - HB_BOOL bRetVal = HB_TRUE; + HB_ERRCODE errCode; + HB_BOOL bRetVal; HB_FHANDLE fhndSource; HB_FHANDLE fhndDest; @@ -78,12 +78,21 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) HB_USHORT nBytesRead; void * pbyBuffer = hb_xgrab( HB_FSCOPY_BUFFERSIZE ); - while( ( nBytesRead = hb_fsRead( fhndSource, pbyBuffer, HB_FSCOPY_BUFFERSIZE ) ) > 0 ) + for( ;; ) { - if( nBytesRead != hb_fsWrite( fhndDest, pbyBuffer, nBytesRead ) ) + if( ( nBytesRead = hb_fsRead( fhndSource, pbyBuffer, HB_FSCOPY_BUFFERSIZE ) ) > 0 ) + { + if( nBytesRead != hb_fsWrite( fhndDest, pbyBuffer, nBytesRead ) ) + { + errCode = hb_fsError(); + bRetVal = HB_FALSE; + break; + } + } + else { errCode = hb_fsError(); - bRetVal = HB_FALSE; + bRetVal = errCode == 0; break; } }