2012-01-09 14:41 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* harbour/src/rdd/dbf1.c
    ! fixed default initialization value in UNICODE fields after
      APPEND BLANK. Many thanks to Phil Krylov for information about
      the problem and patch. The fix I committed is slightly different
      just to follow idea of this code.
This commit is contained in:
Przemyslaw Czerpak
2012-01-09 13:41:32 +00:00
parent 1b4008723b
commit 57eabfaa87
2 changed files with 24 additions and 9 deletions

View File

@@ -16,6 +16,13 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-01-09 14:41 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/src/rdd/dbf1.c
! fixed default initialization value in UNICODE fields after
APPEND BLANK. Many thanks to Phil Krylov for information about
the problem and patch. The fix I committed is slightly different
just to follow idea of this code.
2012-01-06 16:13 UTC+0100 Viktor Szakats (harbour syenar.net)
* ChangeLog
* (whole tree)

View File

@@ -230,11 +230,15 @@ static void hb_dbfSetBlankRecord( DBFAREAP pArea, int iType )
bNext = uiLen == 8 ? ' ' : '\0';
break;
case HB_FT_STRING:
case HB_FT_LOGICAL:
bNext = ' ';
break;
case HB_FT_STRING:
bNext = ( pField->uiFlags & HB_FF_UNICODE ) != 0 ?
HB_BLANK_UNISPACE : ' ';
break;
case HB_FT_LONG:
case HB_FT_FLOAT:
if( pField->uiFlags & HB_FF_AUTOINC )
@@ -291,20 +295,24 @@ static void hb_dbfSetBlankRecord( DBFAREAP pArea, int iType )
}
else
{
if( bFill == HB_BLANK_UNISPACE )
if( nSize )
{
HB_SIZE n;
for( n = 0; n < nSize; n += 2 )
HB_PUT_LE_UINT16( &pPtr[ n ], ' ' );
}
else
memset( pPtr, bFill, nSize );
pPtr += nSize;
nSize = 0;
pPtr += nSize;
nSize = 0;
}
if( bNext == HB_BLANK_SKIP )
{
pPtr += uiLen;
}
else if( bNext == HB_BLANK_UNISPACE )
{
while( uiLen-- )
{
HB_PUT_LE_UINT16( pPtr, 0x0020 );
pPtr += 2;
}
}
else if( bNext == HB_BLANK_AUTOINC )
{
HB_MAXINT nValue = hb_dbfGetNextValue( pArea, uiCount );