2009-05-20 21:25 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* source/vm/set.c
    ! Applied fix sent by Xavi. Thanks.
      I did a few minor formattings and rename, and did a
      light review, please review further and test. I seem to 
      remember some deeper problems with this feature, 
      reported a while ago on the list.
This commit is contained in:
Viktor Szakats
2009-05-20 19:27:06 +00:00
parent 33a1f2abdf
commit c61ec13155
2 changed files with 33 additions and 10 deletions

View File

@@ -17,6 +17,14 @@
past entries belonging to these authors: Viktor Szakats.
*/
2009-05-20 21:25 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/vm/set.c
! Applied fix sent by Xavi. Thanks.
I did a few minor formattings and rename, and did a
light review, please review further and test. I seem to
remember some deeper problems with this feature,
reported a while ago on the list.
2009-05-20 20:02 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* utils/hbmk2/hbmk2.prg
! Added workaround for DIRECTORY() problem under Windows.

View File

@@ -467,6 +467,22 @@ HB_FUNC( SETCANCEL )
hb_setSetItem( HB_SET_CANCEL, hb_param( 1, HB_IT_LOGICAL ) );
}
static void hb_set_PRINTFILE_default( PHB_SET_STRUCT pSet )
{
if( pSet->HB_SET_PRINTFILE )
hb_xfree( pSet->HB_SET_PRINTFILE );
#if defined(HB_OS_UNIX)
pSet->HB_SET_PRINTFILE = hb_strdup( "|lpr" );
#elif defined(HB_OS_DOS)
pSet->HB_SET_PRINTFILE = hb_strdup( "PRN" );
#elif defined(HB_OS_WIN) || defined(HB_OS_OS2)
pSet->HB_SET_PRINTFILE = hb_strdup( "LPT1" );
#else
pSet->HB_SET_PRINTFILE = hb_strdup( "PRN" ); /* TOFIX */
#endif
}
HB_FUNC( SET )
{
HB_STACK_TLS_PRELOAD
@@ -816,7 +832,13 @@ HB_FUNC( SET )
case HB_SET_PRINTFILE:
hb_retc( pSet->HB_SET_PRINTFILE );
if( args > 1 && ! HB_IS_NIL( pArg2 ) )
pSet->HB_SET_PRINTFILE = set_string( pArg2, pSet->HB_SET_PRINTFILE );
{
/* With SET PRINTER TO or Set( _SET_PRINTFILE, "" ) are expected to activate the default printer [jarabal] */
if( hb_itemGetCLen( pArg2 ) == 0 )
hb_set_PRINTFILE_default( pSet );
else
pSet->HB_SET_PRINTFILE = set_string( pArg2, pSet->HB_SET_PRINTFILE );
}
if( args > 2 )
bFlag = set_logical( pArg3, FALSE );
else
@@ -1096,15 +1118,8 @@ void hb_setInitialize( PHB_SET_STRUCT pSet )
pSet->hb_set_path = NULL;
pSet->HB_SET_PRINTER = FALSE;
/* Default printer device */
#if defined(HB_OS_UNIX)
pSet->HB_SET_PRINTFILE = hb_strdup( "|lpr" );
#elif defined(HB_OS_DOS)
pSet->HB_SET_PRINTFILE = hb_strdup( "PRN" );
#elif defined(HB_OS_WIN) || defined(HB_OS_OS2)
pSet->HB_SET_PRINTFILE = hb_strdup( "LPT1" );
#else
pSet->HB_SET_PRINTFILE = hb_strdup( "PRN" ); /* TOFIX */
#endif
pSet->HB_SET_PRINTFILE = NULL;
hb_set_PRINTFILE_default( pSet );
pSet->hb_set_printhan = FS_ERROR;
pSet->HB_SET_SCOREBOARD = TRUE;
pSet->HB_SET_SCROLLBREAK = TRUE;