diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 36584feede..f1bb29b37d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-08-28 14:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/diskspac.c + * formatting + * harbour/source/rtl/disksphb.c + ! fixed typo in numeric drive parameter, now 1->A, 2->B, ..., 0->default + * extract drive letter only when second letter in path is + OS_DRIVE_DELIMITER + 2007-08-28 03:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/diskspac.c * harbour/source/rtl/disksphb.c diff --git a/harbour/source/rtl/diskspac.c b/harbour/source/rtl/diskspac.c index e8f5f1e713..901e523784 100644 --- a/harbour/source/rtl/diskspac.c +++ b/harbour/source/rtl/diskspac.c @@ -105,7 +105,6 @@ HB_FUNC( DISKSPACE ) UINT uiErrMode; /* Get the default drive */ - if( uiDrive == 0 ) uiDrive = hb_fsCurDrv() + 1; diff --git a/harbour/source/rtl/disksphb.c b/harbour/source/rtl/disksphb.c index 374ab2ad36..2594a8fb6c 100644 --- a/harbour/source/rtl/disksphb.c +++ b/harbour/source/rtl/disksphb.c @@ -83,7 +83,7 @@ HB_FUNC( HB_DISKSPACE ) #ifdef OS_HAS_DRIVE_LETTER if( ISNUM( 1 ) ) { - szPathBuf[ 0 ] = ( char ) hb_parni( 1 ); + szPathBuf[ 0 ] = ( char ) hb_parni( 1 ) + 'A' - 1; szPathBuf[ 1 ] = OS_DRIVE_DELIMITER; szPathBuf[ 2 ] = OS_PATH_DELIMITER; szPathBuf[ 3 ] = '\0'; @@ -99,7 +99,8 @@ HB_FUNC( HB_DISKSPACE ) #if defined(HB_OS_DOS) { - USHORT uiDrive = ( szPath[ 0 ] >= 'A' && szPath[ 0 ] <= 'Z' ? + USHORT uiDrive = szPath[ 1 ] != OS_DRIVE_DELIMITER ? 0 : + ( szPath[ 0 ] >= 'A' && szPath[ 0 ] <= 'Z' ? szPath[ 0 ] - 'A' + 1 : ( szPath[ 0 ] >= 'a' && szPath[ 0 ] <= 'z' ? szPath[ 0 ] - 'a' + 1 : 0 ) ); @@ -285,7 +286,8 @@ HB_FUNC( HB_DISKSPACE ) { struct _FSALLOCATE fsa; USHORT rc; - USHORT uiDrive = ( szPath[ 0 ] >= 'A' && szPath[ 0 ] <= 'Z' ? + USHORT uiDrive = szPath[ 1 ] != OS_DRIVE_DELIMITER ? 0 : + ( szPath[ 0 ] >= 'A' && szPath[ 0 ] <= 'Z' ? szPath[ 0 ] - 'A' + 1 : ( szPath[ 0 ] >= 'a' && szPath[ 0 ] <= 'z' ? szPath[ 0 ] - 'a' + 1 : 0 ) );