diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0c2dbba2bf..656d9570f4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-22 23:13 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/compiler/hbcmplib.c + ! fixed reverted order of parameters passed in arrays and missing last + parameter + 2009-06-22 22:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL ! Typo in prev. diff --git a/harbour/source/compiler/hbcmplib.c b/harbour/source/compiler/hbcmplib.c index 637528a23b..2049234b14 100644 --- a/harbour/source/compiler/hbcmplib.c +++ b/harbour/source/compiler/hbcmplib.c @@ -57,8 +57,8 @@ static void hb_compGenArgList( int iFirst, int iLast, int * pArgC, char *** pArgV ) { PHB_ITEM pParam; - ULONG ul; - int argc = 0, i; + ULONG ul, ulLen; + int argc = 1, i; char ** argv; for( i = iFirst; i <= iLast; ++i ) @@ -83,6 +83,7 @@ static void hb_compGenArgList( int iFirst, int iLast, argv = ( char ** ) hb_xgrab( sizeof( char * ) * ( argc + 1 ) ); argc = 0; + argv[ argc++ ] = ( char * ) ""; for( i = iFirst; i <= iLast; ++i ) { pParam = hb_param( i, HB_IT_ARRAY | HB_IT_STRING ); @@ -90,13 +91,12 @@ static void hb_compGenArgList( int iFirst, int iLast, { if( HB_IS_ARRAY( pParam ) ) { - ul = hb_arrayLen( pParam ); - if( ul ) do + ulLen = hb_arrayLen( pParam ); + for( ul = 1; ul <= ulLen; ++ul ) { if( hb_arrayGetType( pParam, ul ) & HB_IT_STRING ) argv[ argc++ ] = hb_arrayGetCPtr( pParam, ul ); } - while( --ul ); } else if( HB_IS_STRING( pParam ) ) argv[ argc++ ] = hb_itemGetCPtr( pParam );