2009-07-21 00:23 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/rtl/net.c
! Fixed NETNAME()/hb_netname() on dos/watcom platforms
in error cases it was leaking 16 bytes of memory.
(+ minor formatting)
Please review me.
+ NETNAME(), HB_USERNAME() now do conversion from OS
codepage. Couldn't test it, please review me.
This commit is contained in:
@@ -17,6 +17,15 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-07-21 00:23 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* source/rtl/net.c
|
||||
! Fixed NETNAME()/hb_netname() on dos/watcom platforms
|
||||
in error cases it was leaking 16 bytes of memory.
|
||||
(+ minor formatting)
|
||||
Please review me.
|
||||
+ NETNAME(), HB_USERNAME() now do conversion from OS
|
||||
codepage. Couldn't test it, please review me.
|
||||
|
||||
2009-07-20 17:45 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbwin/win_reg.prg
|
||||
* contrib/hbwin/win_regc.c
|
||||
|
||||
@@ -129,21 +129,20 @@ char * hb_netname( void )
|
||||
return pszValue;
|
||||
# else
|
||||
union REGS regs;
|
||||
struct SREGS sregs;
|
||||
char * pszValue = ( char * ) hb_xgrab( 16 );
|
||||
pszValue[ 0 ] = '\0';
|
||||
|
||||
regs.HB_XREGS.ax = 0x5E00;
|
||||
regs.HB_XREGS.dx = FP_OFF( pszValue );
|
||||
sregs.ds = FP_SEG( pszValue );
|
||||
|
||||
{
|
||||
struct SREGS sregs;
|
||||
HB_DOS_INT86X( 0x21, ®s, ®s, &sregs );
|
||||
|
||||
regs.HB_XREGS.dx = FP_OFF( pszValue );
|
||||
sregs.ds = FP_SEG( pszValue );
|
||||
if( regs.h.ch == 0 )
|
||||
pszValue = '\0';
|
||||
|
||||
HB_DOS_INT86X( 0x21, ®s, ®s, &sregs );
|
||||
}
|
||||
|
||||
return regs.h.ch == 0 ? hb_strdup( "" ) : pszValue;
|
||||
return pszValue;
|
||||
# endif
|
||||
|
||||
#elif defined( HB_OS_WIN )
|
||||
@@ -193,10 +192,10 @@ char * hb_username( void )
|
||||
|
||||
HB_FUNC( NETNAME )
|
||||
{
|
||||
hb_retc_buffer( hb_netname() );
|
||||
hb_retc_buffer( ( char * ) hb_osDecode( hb_netname(), NULL ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_USERNAME )
|
||||
{
|
||||
hb_retc_buffer( hb_username() );
|
||||
hb_retc_buffer( ( char * ) hb_osDecode( hb_username(), NULL ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user