From 75a272cf20dae89b43b533ec78abbf9939106521 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sat, 8 Jan 2011 18:26:10 +0000 Subject: [PATCH] 2011-01-08 19:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/filesys.c ! fixed function name in HB_TRACE() message * harbour/src/rdd/sdf1.c * harbour/src/rdd/delim1.c * add CHR(26) at the end of COMMA and SDF files only when _SET_EOF is .T. --- harbour/ChangeLog | 8 ++++++++ harbour/src/rdd/delim1.c | 3 ++- harbour/src/rdd/sdf1.c | 3 ++- harbour/src/rtl/filesys.c | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c765da824e..1e620820e7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,14 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-08 19:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/filesys.c + ! fixed function name in HB_TRACE() message + + * harbour/src/rdd/sdf1.c + * harbour/src/rdd/delim1.c + * add CHR(26) at the end of COMMA and SDF files only when _SET_EOF is .T. + 2011-01-08 16:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + src/3rd/png/png.dif * src/3rd/png/Makefile diff --git a/harbour/src/rdd/delim1.c b/harbour/src/rdd/delim1.c index 9d51dffd50..ea359b6dbb 100644 --- a/harbour/src/rdd/delim1.c +++ b/harbour/src/rdd/delim1.c @@ -882,7 +882,8 @@ static HB_ERRCODE hb_delimFlush( DELIMAREAP pArea ) if( pArea->fFlush ) { - hb_fileWriteAt( pArea->pFile, "\032", 1, pArea->nFileSize ); + if( hb_setGetEOF() ) + hb_fileWriteAt( pArea->pFile, "\032", 1, pArea->nFileSize ); if( hb_setGetHardCommit() ) { hb_fileCommit( pArea->pFile ); diff --git a/harbour/src/rdd/sdf1.c b/harbour/src/rdd/sdf1.c index 3fae57978b..810500bff0 100644 --- a/harbour/src/rdd/sdf1.c +++ b/harbour/src/rdd/sdf1.c @@ -713,7 +713,8 @@ static HB_ERRCODE hb_sdfFlush( SDFAREAP pArea ) if( pArea->fFlush ) { - hb_fileWriteAt( pArea->pFile, "\032", 1, pArea->nFileSize ); + if( hb_setGetEOF() ) + hb_fileWriteAt( pArea->pFile, "\032", 1, pArea->nFileSize ); if( hb_setGetHardCommit() ) { hb_fileCommit( pArea->pFile ); diff --git a/harbour/src/rtl/filesys.c b/harbour/src/rtl/filesys.c index 3df504841f..77d9ae3019 100644 --- a/harbour/src/rtl/filesys.c +++ b/harbour/src/rtl/filesys.c @@ -1986,7 +1986,7 @@ HB_BOOL hb_fsTruncAt( HB_FHANDLE hFileHandle, HB_FOFFSET nOffset ) { HB_BOOL fResult; - HB_TRACE(HB_TR_DEBUG, ("hb_fsReadAt(%p, %" PFHL "i)", ( void * ) ( HB_PTRDIFF ) hFileHandle, nOffset)); + HB_TRACE(HB_TR_DEBUG, ("hb_fsTruncAt(%p, %" PFHL "i)", ( void * ) ( HB_PTRDIFF ) hFileHandle, nOffset)); hb_vmUnlock(); #if defined( HB_OS_WIN ) @@ -3188,7 +3188,7 @@ HB_FHANDLE hb_fsExtOpen( const char * pFilename, const char * pDefExt, { /* truncate the file only if properly locked */ hb_fsSeek( hFile, 0, FS_SET ); - hb_fsWrite( hFile, NULL, 0 ); + hb_fsTruncAt( hFile, 0 ); if( hb_fsError() != 0 ) { hb_fsClose( hFile );