20000321-01:10 GMT+1 Victor Szakats <info@szelvesz.hu>

This commit is contained in:
Viktor Szakats
2000-03-21 00:20:54 +00:00
parent bf9fe43d73
commit 5b5c18481c
2 changed files with 12 additions and 6 deletions

View File

@@ -5,6 +5,7 @@
* source/rtl/diskspac.c
! Fixed the default case for Win32.
! Fixed to accept a numeric parameter instead of a string.
* source/rtl/getenv.c
! Fixed to not modify the item buffer directly.

View File

@@ -46,23 +46,20 @@
#define HB_OS_WIN_32_USED
#include <ctype.h>
#include "hbapi.h"
#include "hbapierr.h"
#include "hbapifs.h"
#if defined(DOS) || defined(__WATCOMC__)
#if defined(HB_OS_DOS) || defined(__WATCOMC__)
#include <dos.h>
#endif
HARBOUR HB_DISKSPACE( void )
{
ULONG ulSpaceFree = 0;
USHORT uiDrive = ( ISCHAR( 1 ) && hb_parclen( 1 ) > 0 ) ?
( USHORT )( toupper( *hb_parc( 1 ) ) - 'A' + 1 ) : 0;
USHORT uiDrive = ISNUM( 1 ) ? hb_parni( 1 ) : 0;
#if defined(DOS) || defined(__WATCOMC__)
#if defined(HB_OS_DOS) || defined(__WATCOMC__)
struct diskfree_t disk;
unsigned uiResult;
@@ -90,9 +87,17 @@ HARBOUR HB_DISKSPACE( void )
DWORD dwNumberOfFreeClusters;
DWORD dwTotalNumberOfClusters;
/* Get the default drive */
if( uiDrive == 0 )
{
USHORT uiErrorOld = hb_fsError();
uiDrive = hb_fsCurDrv() + 1;
hb_fsSetError( uiErrorOld );
}
szPath[ 0 ] = uiDrive + 'A' - 1;
szPath[ 1 ] = ':';
szPath[ 2 ] = '\\';