From 35e32d6526c6f354796bfd81eee0ba0473f63a95 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 18 Dec 2007 05:06:04 +0000 Subject: [PATCH] 2007-12-18 06:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbct/files.c * harbour/source/common/hbfsapi.c ! fixes in OS2 build - thanks to David --- harbour/ChangeLog | 5 +++++ harbour/contrib/hbct/files.c | 8 +++++--- harbour/source/common/hbfsapi.c | 12 ++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 90bec4f3c0..a37c1c9ed8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-12-18 06:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/hbct/files.c + * harbour/source/common/hbfsapi.c + ! fixes in OS2 build - thanks to David + 2007-12-17 21:40 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * bin/bld.bat ! %HB_USER_LIBS% (for bcc32) moved to the beginning of the lib list. diff --git a/harbour/contrib/hbct/files.c b/harbour/contrib/hbct/files.c index 5fc476fafb..ca48e536bd 100644 --- a/harbour/contrib/hbct/files.c +++ b/harbour/contrib/hbct/files.c @@ -226,8 +226,10 @@ HB_FUNC( SETFATTR ) #elif defined( HB_OS_OS2 ) FILESTATUS3 fs3; - ULONG ulAttr = FILE_NORMAL; APIRET ulrc; + ULONG ulAttr = FILE_NORMAL; + int iAttr = hb_parni( 2 ); + const char *szFile = hb_parcx( 1 ); if( iAttr & FA_READONLY ) ulAttr |= FILE_READONLY; @@ -238,11 +240,11 @@ HB_FUNC( SETFATTR ) if( iAttr & FA_ARCHIVE ) ulAttr |= FILE_ARCHIVED; - ulrc = DosQueryPathInfo( pszPathName, FIL_STANDARD, &fs3, sizeof( fs3 ) ); + ulrc = DosQueryPathInfo( szFile, FIL_STANDARD, &fs3, sizeof( fs3 ) ); if( ulrc == NO_ERROR ) { fs3.attrFile = ulAttr; - ulrc = DosSetPathInfo( pszPathName, FIL_STANDARD, + ulrc = DosSetPathInfo( szFile, FIL_STANDARD, &fs3, sizeof( fs3 ), DSPI_WRTTHRU ); } hb_retni( ulrc ); diff --git a/harbour/source/common/hbfsapi.c b/harbour/source/common/hbfsapi.c index 3d89991960..e696b35bea 100644 --- a/harbour/source/common/hbfsapi.c +++ b/harbour/source/common/hbfsapi.c @@ -326,9 +326,9 @@ HB_EXPORT BOOL hb_fsFileExists( const char * pszFileName ) #elif defined( HB_OS_OS2 ) { FILESTATUS3 fs3; - if( DosQueryPathInfo( pszFileName, FIL_STANDARD, - &fs3, sizeof( fs3 ) ) == NO_ERROR ) - fExist = ( fs3.attrFile & FILE_DIRECTORY ) == 0; + fExist = DosQueryPathInfo( pszFileName, FIL_STANDARD, + &fs3, sizeof( fs3 ) ) == NO_ERROR && + ( fs3.attrFile & FILE_DIRECTORY ) == 0; } #elif defined( HB_OS_UNIX ) { @@ -385,9 +385,9 @@ HB_EXPORT BOOL hb_fsDirExists( const char * pszDirName ) #elif defined( HB_OS_OS2 ) { FILESTATUS3 fs3; - if( DosQueryPathInfo( pszDirName, FIL_STANDARD, - &fs3, sizeof( fs3 ) ) == NO_ERROR ) - fExist = ( fs3.attrFile & FILE_DIRECTORY ) != 0; + fExist = DosQueryPathInfo( pszDirName, FIL_STANDARD, + &fs3, sizeof( fs3 ) ) == NO_ERROR && + ( fs3.attrFile & FILE_DIRECTORY ) != 0; } #elif defined( HB_OS_UNIX ) {