2012-04-24 02:16 UTC+0200 Viktor Szakats (harbour syenar.net)

* src/rtl/filesys.c
    % fs_win_get_drive() simplified for win platform, eliminated 
      mb conversion. Code posted by Przemek.
This commit is contained in:
Viktor Szakats
2012-04-24 00:19:21 +00:00
parent cd0cc92c3d
commit 16ad8bfcb3
2 changed files with 14 additions and 21 deletions

View File

@@ -16,6 +16,11 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-04-24 02:16 UTC+0200 Viktor Szakats (harbour syenar.net)
* src/rtl/filesys.c
% fs_win_get_drive() simplified for win platform, eliminated
mb conversion. Code posted by Przemek.
2012-04-23 20:31 UTC+0200 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/hbmk2.prg
+ added experimental framework for -ku:<cp> option. It is

View File

@@ -347,29 +347,17 @@ static HB_BOOL s_fUseWaitLocks = HB_TRUE;
static int fs_win_get_drive( void )
{
TCHAR lpBuffer[ HB_PATH_MAX ];
int iDrive;
char szBuffer[ HB_PATH_MAX ];
PHB_FNAME pFilepath;
#if defined( UNICODE )
{
TCHAR lpBuffer[ HB_PATH_MAX ];
hb_fsSetIOError( GetCurrentDirectory( HB_SIZEOFARRAY( lpBuffer ), lpBuffer ) != 0, 0 );
lpBuffer[ HB_SIZEOFARRAY( lpBuffer ) - 1 ] = L'\0';
hb_wcntombcpy( szBuffer, lpBuffer, HB_SIZEOFARRAY( lpBuffer ) - 1 );
}
#else
hb_fsSetIOError( GetCurrentDirectory( HB_SIZEOFARRAY( szBuffer ), szBuffer ) != 0, 0 );
#endif
pFilepath = hb_fsFNameSplit( szBuffer );
if( pFilepath->szDrive )
iDrive = HB_TOUPPER( pFilepath->szDrive[ 0 ] ) - 'A';
lpBuffer[ 0 ] = TEXT( '\0' );
hb_fsSetIOError(
GetCurrentDirectory( HB_SIZEOFARRAY( lpBuffer ), lpBuffer ) != 0, 0 );
iDrive = HB_TOUPPER( lpBuffer[ 0 ] );
if( iDrive >= 'A' && iDrive <= 'Z' &&
lpBuffer[ 1 ] == HB_OS_DRIVE_DELIM_CHR )
iDrive -= 'A';
else
iDrive = 0;
hb_xfree( pFilepath );
iDrive = 0;
return iDrive;
}