From c85ff7b5444b8ea5443cec0d81276015b19191bd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 9 May 2011 17:06:21 +0000 Subject: [PATCH] 2011-05-09 19:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/memofile.c ! enabled EOF char on *nix platforms * src/rtl/base64d.c * uppercase hex nums to be in sync with base64c.c --- harbour/ChangeLog | 9 ++++++++- harbour/src/rtl/base64d.c | 8 ++++---- harbour/src/rtl/memofile.c | 8 -------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 79c578bd47..c7a700aca6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-09 19:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/memofile.c + ! enabled EOF char on *nix platforms + + * src/rtl/base64d.c + * uppercase hex nums to be in sync with base64c.c + 2011-05-09 18:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * examples/httpsrv/uhttpd.prg * examples/httpsrv/cookie.prg @@ -35,7 +42,7 @@ MEMOWRITE() is disabled by default - IMHO it's wrong because it's not possible to use these functions to exchange safely data with CA-Cl*pper applications or even DOS/Windows - versions of Harbour applications. + versions of Harbour applications. [DONE] * harbour/src/rtl/hbcom.c * replaced infinite waiting for reading/writing from/to serial port diff --git a/harbour/src/rtl/base64d.c b/harbour/src/rtl/base64d.c index d201bcd7c2..e32a611b2d 100644 --- a/harbour/src/rtl/base64d.c +++ b/harbour/src/rtl/base64d.c @@ -90,7 +90,7 @@ static HB_SIZE base64_decode_block( const char * code_in, const HB_SIZE length_i fragment = base64_decode_value( *codechar++ ); } while( fragment < 0 ); - *pszPlainchar = ( fragment & 0x03f ) << 2; + *pszPlainchar = ( fragment & 0x03F ) << 2; do { @@ -100,7 +100,7 @@ static HB_SIZE base64_decode_block( const char * code_in, const HB_SIZE length_i } while( fragment < 0 ); *pszPlainchar++ |= ( fragment & 0x030 ) >> 4; - *pszPlainchar = ( fragment & 0x00f ) << 4; + *pszPlainchar = ( fragment & 0x00F ) << 4; do { @@ -109,7 +109,7 @@ static HB_SIZE base64_decode_block( const char * code_in, const HB_SIZE length_i fragment = base64_decode_value( *codechar++ ); } while( fragment < 0 ); - *pszPlainchar++ |= ( fragment & 0x03c ) >> 2; + *pszPlainchar++ |= ( fragment & 0x03C ) >> 2; *pszPlainchar = ( fragment & 0x003 ) << 6; do @@ -119,7 +119,7 @@ static HB_SIZE base64_decode_block( const char * code_in, const HB_SIZE length_i fragment = base64_decode_value( *codechar++ ); } while( fragment < 0 ); - *pszPlainchar++ |= ( fragment & 0x03f ); + *pszPlainchar++ |= ( fragment & 0x03F ); } } diff --git a/harbour/src/rtl/memofile.c b/harbour/src/rtl/memofile.c index 8bba97debf..fde884330b 100644 --- a/harbour/src/rtl/memofile.c +++ b/harbour/src/rtl/memofile.c @@ -78,15 +78,11 @@ static void hb_memoread( HB_BOOL bHandleEOF ) nSize = hb_fsReadLarge( fhnd, pbyBuffer, nSize ); /* Don't read the file terminating EOF character */ -#if ! defined( HB_OS_UNIX ) if( bHandleEOF && nSize > 0 ) { if( pbyBuffer[ nSize - 1 ] == HB_CHAR_EOF ) --nSize; } -#else - HB_SYMBOL_UNUSED( bHandleEOF ); -#endif hb_retclen_buffer( pbyBuffer, nSize ); } @@ -130,15 +126,11 @@ static HB_BOOL hb_memowrit( HB_BOOL bHandleEOF ) /* NOTE: CA-Cl*pper will add the EOF even if the write failed. [vszakats] */ /* NOTE: CA-Cl*pper will not return .F. when the EOF could not be written. [vszakats] */ -#if ! defined( HB_OS_UNIX ) if( bHandleEOF && bRetVal ) /* if true, then write EOF */ { char cEOF = HB_CHAR_EOF; hb_fsWrite( fhnd, &cEOF, sizeof( char ) ); } -#else - HB_SYMBOL_UNUSED( bHandleEOF ); -#endif hb_fsClose( fhnd ); }