From a29bb9d822b567929268719fb28df7d5cb69e5e8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 26 Jul 2010 13:09:19 +0000 Subject: [PATCH] 2010-07-26 15:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/fscopy.c ! Fixed to properly set FERROR() values. * contrib/hbnetio/utils/netiosrv.prg ! Do not pass the password by reference. --- harbour/ChangeLog | 7 +++++++ harbour/contrib/hbnetio/utils/netiosrv.prg | 2 +- harbour/src/rtl/fscopy.c | 19 +++++++++++++------ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e4ef72d55d..c1f595578c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-26 15:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/fscopy.c + ! Fixed to properly set FERROR() values. + + * contrib/hbnetio/utils/netiosrv.prg + ! Do not pass the password by reference. + 2010-07-26 12:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/tests/wvtqt.hbp * contrib/hbxbp/tests/wvtqt.hbp diff --git a/harbour/contrib/hbnetio/utils/netiosrv.prg b/harbour/contrib/hbnetio/utils/netiosrv.prg index 415703bd82..83c1593dbc 100644 --- a/harbour/contrib/hbnetio/utils/netiosrv.prg +++ b/harbour/contrib/hbnetio/utils/netiosrv.prg @@ -145,7 +145,7 @@ PROCEDURE Main( ... ) netiosrv[ _NETIOSRV_cIFAddr ],; netiosrv[ _NETIOSRV_cRootDir ],; iif( Empty( netiosrv[ _NETIOSRV_cRPCFHRB ] ), netiosrv[ _NETIOSRV_lRPC ], hb_hrbGetFunSym( netiosrv[ _NETIOSRV_cRPCFHRB ], _RPC_FILTER ) ),; - @cPassword ) + cPassword ) netiosrv[ _NETIOSRV_lEncryption ] := ! Empty( cPassword ) cPassword := NIL diff --git a/harbour/src/rtl/fscopy.c b/harbour/src/rtl/fscopy.c index 5e644fe4b0..b86cdf6a6d 100644 --- a/harbour/src/rtl/fscopy.c +++ b/harbour/src/rtl/fscopy.c @@ -62,6 +62,7 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) { + HB_ERRCODE errCode = 0; HB_BOOL bRetVal = HB_TRUE; HB_FHANDLE fhndSource; HB_FHANDLE fhndDest; @@ -81,6 +82,7 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) { if( nBytesRead != hb_fsWrite( fhndDest, pbyBuffer, nBytesRead ) ) { + errCode = hb_fsError(); bRetVal = HB_FALSE; break; } @@ -96,28 +98,33 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) hb_fsClose( fhndDest ); } else + { + errCode = hb_fsError(); bRetVal = HB_FALSE; + } hb_fsClose( fhndSource ); } else + { + errCode = hb_fsError(); bRetVal = HB_FALSE; + } + + hb_fsSetFError( errCode ); return bRetVal; } HB_FUNC( HB_FCOPY ) { - HB_ERRCODE uiError = 2; const char * pszSource = hb_parc( 1 ), * pszDest = hb_parc( 2 ); if( pszSource && pszDest ) - { hb_retni( hb_fsCopy( pszSource, pszDest ) ? 0 : F_ERROR ); - uiError = hb_fsError(); - } else + { + hb_fsSetFError( 2 ); hb_retni( F_ERROR ); - - hb_fsSetFError( uiError ); + } }