diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b897d5921f..ccf95e974b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,24 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-03 12:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rdd/dbf1.c + ! fixed DBI_ENCRYPT to use previously set password if no new one + is given + + * harbour/src/rdd/hbsix/sxtable.c + ! fixed wrong parameter checking in SX_SETPASS() + ! removed wrong comment about optional parameter in SX_DBFENCRYPT() + + * harbour/src/vm/cmdarg.c + ! added missing OS CP conversion in HB_ARGV() + + * harbour/contrib/hbct/ctmisc.prg + * use HB_PROGNAME() instead of HB_ARGV( 0 ) in EXENAME() + + * harbour/contrib/hbnetio/readme.txt + ! fixed two typos in description + 2011-02-03 12:27 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/3rd/pcre/Makefile ! Disabled inttypes.h also for msvcarm. diff --git a/harbour/contrib/hbct/ctmisc.prg b/harbour/contrib/hbct/ctmisc.prg index cff92ece39..b2ff2a1572 100644 --- a/harbour/contrib/hbct/ctmisc.prg +++ b/harbour/contrib/hbct/ctmisc.prg @@ -117,4 +117,4 @@ FUNCTION DOSPARAM() RETURN cRet FUNCTION EXENAME() - RETURN HB_ARGV( 0 ) + RETURN HB_PROGNAME() diff --git a/harbour/contrib/hbnetio/readme.txt b/harbour/contrib/hbnetio/readme.txt index 34e794dbde..04c1911885 100644 --- a/harbour/contrib/hbnetio/readme.txt +++ b/harbour/contrib/hbnetio/readme.txt @@ -33,7 +33,7 @@ Client side functions: more then one thread call NETIO_CONNECT() then only one connection is created. It also means that NETIO_DISCONNECT() does not have to be called by the same thread which called NETIO_CONNECT(). - On application exist all connections are automatically closed. + On application exit all connections are automatically closed. It possible to open many different connections and keep them open. In RDD IO operations and RPC calls it's possible to specify server address as part of file or procedure/function name, i.e. @@ -54,7 +54,7 @@ Client side functions: is terminated by CHR(0) so it's not possible to use these two characters as part of password. Anyhow when passwords are required then it's recommended to open the connection by NETIO_CONNECT() - and then specify only server and port is server is not unique + and then specify only server and port if server is not unique enough to chose from existing connections. If server is not given then default connection is chosen. diff --git a/harbour/src/rdd/dbf1.c b/harbour/src/rdd/dbf1.c index d5899d052c..30410ce505 100644 --- a/harbour/src/rdd/dbf1.c +++ b/harbour/src/rdd/dbf1.c @@ -619,14 +619,20 @@ static void hb_dbfTableCrypt( DBFAREAP pArea, PHB_ITEM pPasswd, HB_BOOL fEncrypt pArea->pCryptKey = NULL; hb_dbfPasswordSet( pArea, pPasswd, HB_FALSE ); pNewCryptKey = pArea->pCryptKey; - if( !fEncrypt && pNewCryptKey ) + if( !fEncrypt ) { - if( pOldCryptKey ) - hb_xfree( pNewCryptKey ); - else - pOldCryptKey = pNewCryptKey; - pNewCryptKey = NULL; + if( pNewCryptKey ) + { + if( pOldCryptKey ) + hb_xfree( pNewCryptKey ); + else + pOldCryptKey = pNewCryptKey; + pNewCryptKey = NULL; + } } + else if( !pNewCryptKey ) + pNewCryptKey = pOldCryptKey; + for( ulRecNo = 1; ulRecNo <= ulRecords; ++ulRecNo ) { pArea->pCryptKey = pOldCryptKey; @@ -654,7 +660,7 @@ static void hb_dbfTableCrypt( DBFAREAP pArea, PHB_ITEM pPasswd, HB_BOOL fEncrypt break; } pArea->pCryptKey = pNewCryptKey; - if( pOldCryptKey ) + if( pOldCryptKey && pOldCryptKey != pNewCryptKey ) hb_xfree( pOldCryptKey ); if( errCode == HB_SUCCESS ) { diff --git a/harbour/src/rdd/hbsix/sxtable.c b/harbour/src/rdd/hbsix/sxtable.c index 94f99204c3..8425dc5846 100644 --- a/harbour/src/rdd/hbsix/sxtable.c +++ b/harbour/src/rdd/hbsix/sxtable.c @@ -287,7 +287,7 @@ HB_FUNC( SX_SETPASS ) HB_BOOL fResult = HB_FALSE; PHB_ITEM pItem; - if( iPCount >=1 ) + if( iPCount == 1 ) { if( HB_ISCHAR( 1 ) ) { @@ -301,7 +301,7 @@ HB_FUNC( SX_SETPASS ) } } } - else if( iPCount >= 2 || iPCount <= 4 ) + else if( iPCount >= 2 && iPCount <= 4 ) { if( HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) && ( iPCount < 3 || HB_ISCHAR( 3 ) ) && ( iPCount < 4 || HB_ISNUM( 4 ) ) ) @@ -366,12 +366,8 @@ HB_FUNC( SX_DBFENCRYPT ) if( pArea ) { - /* Optional parameter with password is Harbour extension */ -#ifdef HB_SIX3_STRICT - PHB_ITEM pItem = hb_itemNew( NULL ); -#else PHB_ITEM pItem = hb_itemParam( 1 ); -#endif + if( SELF_INFO( pArea, DBI_ENCRYPT, pItem ) == HB_SUCCESS ) fResult = hb_itemGetL( pItem ); hb_itemRelease( pItem ); diff --git a/harbour/src/vm/cmdarg.c b/harbour/src/vm/cmdarg.c index 35d01c9ca5..125436e8fc 100644 --- a/harbour/src/vm/cmdarg.c +++ b/harbour/src/vm/cmdarg.c @@ -450,7 +450,18 @@ HB_FUNC( HB_ARGV ) { int argc = hb_parni( 1 ); - hb_retc( ( argc >= 0 && argc < s_argc ) ? s_argv[ argc ] : NULL ); + if( argc >= 0 && argc < s_argc ) + { + char * pszFree = NULL; + const char * szArgV = hb_osDecodeCP( s_argv[ argc ], &pszFree, NULL ); + + if( pszFree ) + hb_retc_buffer( pszFree ); + else + hb_retc( szArgV ); + } + else + hb_retc_null(); } HB_FUNC( HB_ARGSHIFT )