diff --git a/ChangeLog.txt b/ChangeLog.txt index c107b190a8..ae32cc0851 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,11 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-09-20 15:42 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rdd/dbcmd.c + ! fixed dbRSelect() to be compatible with undocumented Cl*pper behavior: + When parameter is missing, wrong or 0 then 1 is used as relation number + 2013-09-20 15:30 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/hbgtcore.c ! added explicit casting to strchr() result diff --git a/src/rdd/dbcmd.c b/src/rdd/dbcmd.c index 3e4bc5f70c..87df3b4728 100644 --- a/src/rdd/dbcmd.c +++ b/src/rdd/dbcmd.c @@ -1741,11 +1741,15 @@ HB_FUNC( DBRELATION ) /* () --> cLinkExp */ HB_FUNC( DBRSELECT ) /* () --> nWorkArea */ { - HB_USHORT uiWorkArea = 0; + HB_USHORT uiWorkArea = 0, uiRelation = ( HB_USHORT ) hb_parni( 1 ); AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); if( pArea ) - SELF_RELAREA( pArea, ( HB_USHORT ) hb_parni( 1 ), &uiWorkArea ); + /* undocumented CA-Cl*pper behavior: + * When parameter is missing, wrong or 0 then 1 is used as + * relation number [druzus] + */ + SELF_RELAREA( pArea, uiRelation ? uiRelation : 1, &uiWorkArea ); hb_retni( uiWorkArea ); }