From c587792c985e2fb334fa6d8d62a537c2161779f6 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 4 Aug 2008 10:59:10 +0000 Subject: [PATCH] 2008-08-04 12:58 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/pp/ppcore.c * cleaned warning * harbour/source/rtl/set.c * do not attach ".prn" extension to known device names also in DOS and Windows builds * recognize "CON" as device name in DOS, Win and OS2 builds --- harbour/ChangeLog | 9 +++++++++ harbour/source/pp/ppcore.c | 2 +- harbour/source/rtl/set.c | 8 +++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cb79a8d273..2610f57533 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,15 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-08-04 12:58 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/pp/ppcore.c + * cleaned warning + + * harbour/source/rtl/set.c + * do not attach ".prn" extension to known device names also + in DOS and Windows builds + * recognize "CON" as device name in DOS, Win and OS2 builds + 2008-08-04 11:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * source/debug/debugger.prg ! Avoided __PLATFORM__* macros in core code by using diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 029c44166f..7882883351 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -1552,7 +1552,7 @@ static int hb_pp_tokenStr( PHB_PP_TOKEN pToken, PHB_MEM_BUFFER pBuffer, hb_membufAddCh( pBuffer, ch ); hb_membufAddData( pBuffer, pToken->value, pToken->len ); - hb_membufAddCh( pBuffer, ch == '[' ? ']' : ch ); + hb_membufAddCh( pBuffer, ( char ) ( ch == '[' ? ']' : ch ) ); } } else diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index 21be6d8092..9324f425b4 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -221,11 +221,13 @@ static FHANDLE open_handle( char * file_name, BOOL bAppend, char * def_ext, HB_s if( hb_set.HB_SET_DEFEXTENSIONS && pFilename->szExtension == NULL && def_ext ) { -#if defined(HB_OS_OS2) +#if defined(HB_OS_OS2) || defined(HB_OS_W32) || defined(HB_OS_DOS) if( pFilename->szName ) { int iLen = ( int ) strlen( pFilename->szName ); - if( ( iLen == 3 && hb_stricmp( pFilename->szName, "PRN" ) == 0 ) || + if( ( iLen == 3 && + ( hb_stricmp( pFilename->szName, "PRN" ) == 0 || + hb_stricmp( pFilename->szName, "CON" ) == 0 ) ) || ( iLen == 4 && ( ( hb_strnicmp( pFilename->szName, "LPT", 3 ) == 0 && pFilename->szName[3] >= '1' && pFilename->szName[3] <= '3' ) || @@ -1006,7 +1008,7 @@ void hb_setInitialize( void ) hb_set.HB_SET_PRINTFILE = hb_strdup( "|lpr" ); #elif defined(HB_OS_DOS) hb_set.HB_SET_PRINTFILE = hb_strdup( "PRN" ); -#elif defined(HB_OS_WIN_32) +#elif defined(HB_OS_WIN_32) || defined(HB_OS_OS2) hb_set.HB_SET_PRINTFILE = hb_strdup( "LPT1" ); #else hb_set.HB_SET_PRINTFILE = hb_strdup( "PRN" ); /* TOFIX */