2012-04-24 07:18 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* harbour/include/hbgtcore.h
    ! fixed typo in HB_GTSELF_KEYTRANS() macro.
      It should also fix problem with function keys in some GTs,
      i.e. ENTER in GTOS2 ALERT() reported by David.

  * harbour/src/rtl/filesys.c
    * use TEXT() macro
    * minor modification in fs_win_get_drive()

  * harbour/src/vm/hvm.c
    * added protection against potential memory leak if
      programmer change type of enumerated item
This commit is contained in:
Przemyslaw Czerpak
2012-04-24 05:18:24 +00:00
parent 16ad8bfcb3
commit 8d23393d83
4 changed files with 38 additions and 19 deletions

View File

@@ -16,6 +16,20 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-04-24 07:18 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/include/hbgtcore.h
! fixed typo in HB_GTSELF_KEYTRANS() macro.
It should also fix problem with function keys in some GTs,
i.e. ENTER in GTOS2 ALERT() reported by David.
* harbour/src/rtl/filesys.c
* use TEXT() macro
* minor modification in fs_win_get_drive()
* harbour/src/vm/hvm.c
* added protection against potential memory leak if
programmer change type of enumerated item
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

View File

@@ -367,7 +367,7 @@ extern HB_EXPORT void hb_gt_gcMark( void );
#define HB_GTSELF_CPBOX(g) ((g)->cdpBox)
#define HB_GTSELF_CPIN(g) ((g)->cdpIn)
#define HB_GTSELF_KEYTRANS(g,k) (((k)>=127 && (k)<=255 && (g)->cdpIn) ? hb_cdpGetWC((g)->cdpIn,(HB_UCHAR)(k),0) : (k))
#define HB_GTSELF_KEYTRANS(g,k) (((k)>=127 && (k)<=255 && (g)->cdpIn) ? hb_cdpGetWC((g)->cdpIn,(HB_UCHAR)(k),0) : 0)
#define HB_GTSELF_LOCK(g) (g)->pFuncTable->Lock(g)

View File

@@ -348,17 +348,20 @@ static HB_BOOL s_fUseWaitLocks = HB_TRUE;
static int fs_win_get_drive( void )
{
TCHAR lpBuffer[ HB_PATH_MAX ];
int iDrive;
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;
DWORD dwResult;
int iDrive = 0;
lpBuffer[ 0 ] = TEXT( '\0' );
dwResult = GetCurrentDirectory( HB_SIZEOFARRAY( lpBuffer ), lpBuffer );
hb_fsSetIOError( dwResult != 0, 0 );
if( dwResult >= 2 && lpBuffer[ 1 ] == HB_OS_DRIVE_DELIM_CHR )
{
iDrive = HB_TOUPPER( lpBuffer[ 0 ] );
if( iDrive >= 'A' && iDrive <= 'Z' )
iDrive -= 'A';
else
iDrive = 0;
}
return iDrive;
}
@@ -3228,9 +3231,9 @@ HB_ERRCODE hb_fsCurDirBuff( int iDrive, char * pszBuffer, HB_SIZE nSize )
{
DWORD dwSize = ( DWORD ) nSize;
LPTSTR lpBuffer = ( LPTSTR ) hb_xgrab( dwSize * sizeof( TCHAR ) );
lpBuffer[ 0 ] = L'\0';
lpBuffer[ 0 ] = TEXT( '\0' );
hb_fsSetIOError( ( GetCurrentDirectory( dwSize, lpBuffer ) != 0 ), 0 );
lpBuffer[ dwSize - 1 ] = L'\0';
lpBuffer[ dwSize - 1 ] = TEXT( '\0' );
HB_OSSTRDUP2( lpBuffer, pszBuffer, nSize - 1 );
hb_xfree( lpBuffer );
}

View File

@@ -4771,9 +4771,10 @@ static void hb_vmEnumNext( void )
if( ( HB_SIZE ) ++pEnum->item.asEnum.offset >
pBase->item.asString.length )
break;
hb_itemPutCL( pEnum->item.asEnum.valuePtr,
pBase->item.asString.value +
pEnum->item.asEnum.offset - 1, 1 );
pEnum->item.asEnum.valuePtr = hb_itemPutCL(
pEnum->item.asEnum.valuePtr,
pBase->item.asString.value +
pEnum->item.asEnum.offset - 1, 1 );
}
else
{
@@ -4848,9 +4849,10 @@ static void hb_vmEnumPrev( void )
{
if( --pEnum->item.asEnum.offset == 0 )
break;
hb_itemPutCL( pEnum->item.asEnum.valuePtr,
pBase->item.asString.value +
pEnum->item.asEnum.offset - 1, 1 );
pEnum->item.asEnum.valuePtr = hb_itemPutCL(
pEnum->item.asEnum.valuePtr,
pBase->item.asString.value +
pEnum->item.asEnum.offset - 1, 1 );
}
else
{