2015-05-05 20:06 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/rtl/disksphb.c
    * added default path setting in hb_fsDiskSpace()

  * src/rtl/vfile.c
    * removed recent modification - it's not longer necessary
This commit is contained in:
Przemysław Czerpak
2015-05-05 20:06:34 +02:00
parent 93623a1528
commit bbf3bcf147
3 changed files with 24 additions and 11 deletions

View File

@@ -10,6 +10,13 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2015-05-05 20:06 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/disksphb.c
* added default path setting in hb_fsDiskSpace()
* src/rtl/vfile.c
* removed recent modification - it's not longer necessary
2015-05-05 19:50 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/vfile.c
! do not pass NULL pointer to hb_fileDirSpace()

View File

@@ -77,11 +77,19 @@
double hb_fsDiskSpace( const char * pszPath, HB_USHORT uiType )
{
char szPathBuf[ 2 ];
double dSpace = 0.0;
if( uiType > HB_DISK_TOTAL )
uiType = HB_DISK_AVAIL;
if( ! pszPath )
{
szPathBuf[ 0 ] = HB_OS_PATH_DELIM_CHR;
szPathBuf[ 1 ] = '\0';
pszPath = szPathBuf;
}
#if defined( HB_OS_WIN )
{
LPCTSTR lpPath;
@@ -368,27 +376,25 @@ double hb_fsDiskSpace( const char * pszPath, HB_USHORT uiType )
HB_FUNC( HB_DISKSPACE )
{
const char * pszPath = hb_parc( 1 );
char szPathBuf[ 4 ];
HB_USHORT uiType = ( HB_USHORT ) hb_parnidef( 2, HB_DISK_AVAIL );
#ifdef HB_OS_HAS_DRIVE_LETTER
char szPathBuf[ 4 ];
if( ! pszPath )
{
#ifdef HB_OS_HAS_DRIVE_LETTER
if( HB_ISNUM( 1 ) )
int iDrive = hb_parni( 1 );
if( iDrive >= 1 && iDrive < 32 )
{
szPathBuf[ 0 ] = ( char ) hb_parni( 1 ) + 'A' - 1;
szPathBuf[ 0 ] = ( char ) iDrive + 'A' - 1;
szPathBuf[ 1 ] = HB_OS_DRIVE_DELIM_CHR;
szPathBuf[ 2 ] = HB_OS_PATH_DELIM_CHR;
szPathBuf[ 3 ] = '\0';
}
else
#endif
{
szPathBuf[ 0 ] = HB_OS_PATH_DELIM_CHR;
szPathBuf[ 1 ] = '\0';
}
pszPath = szPathBuf;
}
#endif
hb_retnlen( hb_fsDiskSpace( pszPath, uiType ), -1, 0 );
}

View File

@@ -272,7 +272,7 @@ HB_FUNC( HB_VFDIRSPACE )
{
HB_USHORT uiType = ( HB_USHORT ) hb_parnidef( 2, HB_DISK_AVAIL );
hb_retnlen( hb_fileDirSpace( hb_parcx( 1 ), uiType ), -1, 0 );
hb_retnlen( hb_fileDirSpace( hb_parc( 1 ), uiType ), -1, 0 );
hb_fsSetFError( hb_fsError() );
}