From c227481f42ba8b064ae78cd4aeca76150280dc5d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 24 Nov 2009 15:58:17 +0000 Subject: [PATCH] 2009-11-24 16:57 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/fscopy.c ! Fixed to use the same file opening method as in __COPYFILE(). This should fix creating zero byte file on OS/2 when the source and target file is the same. ; Please test. * contrib/hbwin/win_prn3.c * Minor. --- harbour/ChangeLog | 10 ++++++++++ harbour/contrib/hbwin/win_prn3.c | 2 +- harbour/src/rtl/fscopy.c | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3f7bf52a0e..e84b80bcb1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-24 16:57 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/fscopy.c + ! Fixed to use the same file opening method as in __COPYFILE(). + This should fix creating zero byte file on OS/2 when the source + and target file is the same. + ; Please test. + + * contrib/hbwin/win_prn3.c + * Minor. + 2009-11-24 16:48 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/vm/dlmalloc.c % use harbour spin locks if available by default in all builds diff --git a/harbour/contrib/hbwin/win_prn3.c b/harbour/contrib/hbwin/win_prn3.c index ad5d26d30a..9670ce0a17 100644 --- a/harbour/contrib/hbwin/win_prn3.c +++ b/harbour/contrib/hbwin/win_prn3.c @@ -258,7 +258,7 @@ HB_FUNC( WIN_PRINTERSETDEFAULT ) HB_TCHAR_FREE( lpPrinterName ); } else - hb_retl( FALSE ); + hb_retl( HB_FALSE ); } #endif diff --git a/harbour/src/rtl/fscopy.c b/harbour/src/rtl/fscopy.c index 5615188f4e..49133df5d9 100644 --- a/harbour/src/rtl/fscopy.c +++ b/harbour/src/rtl/fscopy.c @@ -66,9 +66,9 @@ BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) HB_FHANDLE fhndSource; HB_FHANDLE fhndDest; - if( ( fhndSource = hb_fsOpen( pszSource, FO_READ | FO_DENYNONE ) ) != FS_ERROR ) + if( ( fhndSource = hb_fsExtOpen( pszSource, NULL, FO_READ | FXO_DEFAULTS | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) { - if( ( fhndDest = hb_fsCreate( pszDest, FC_NORMAL ) ) != FS_ERROR ) + if( ( fhndDest = hb_fsExtOpen( pszDest, NULL, FXO_TRUNCATE | FO_READWRITE | FO_EXCLUSIVE | FXO_DEFAULTS | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) { #if defined( HB_OS_UNIX ) struct stat struFileInfo;