diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a5828da19a..1affb3017a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-04-20 17:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/hbqt/hbqt.h + ! fixed QT directory names in #include directives for case sensitive + file systems + + * harbour/source/vm/cmdarg.c + ! fixed HB_CMDLINE() to work with linear not square cost. + 2009-04-20 16:30 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.hbm + Added -km option. diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h index eae4faea47..8e59cd7b51 100644 --- a/harbour/contrib/hbqt/hbqt.h +++ b/harbour/contrib/hbqt/hbqt.h @@ -56,12 +56,12 @@ #ifndef __HBQT_H #define __HBQT_H -#include -#include -#include -#include -#include -#include +#include +#include +#include +/* #include */ +#include +#include #if QT_VERSION >= 0x040500 diff --git a/harbour/source/vm/cmdarg.c b/harbour/source/vm/cmdarg.c index 28c2be5d23..b7d21731a6 100644 --- a/harbour/source/vm/cmdarg.c +++ b/harbour/source/vm/cmdarg.c @@ -441,33 +441,35 @@ HB_FUNC( HB_ARGV ) HB_FUNC( HB_CMDLINE ) { - char * pszBuffer; - BOOL fFree; - int nLen; - int nPos; - - int argc = hb_cmdargARGC(); char** argv = hb_cmdargARGV(); + int argc = hb_cmdargARGC(); + char * pszBuffer, * ptr; + ULONG ulLen; + int iArg; - if( argc ) + ulLen = 0; + for( iArg = 1; iArg < argc; iArg++ ) + ulLen += ( ULONG ) strlen( argv[ iArg ] ) + 1; + + if( ulLen ) { - nLen = 1; - for( nPos = 1; nPos < argc; nPos++ ) - nLen += ( int ) strlen( argv[ nPos ] ) + 1; - - pszBuffer = ( char * ) hb_xgrab( nLen + 1 ); - - pszBuffer[ 0 ] = '\0'; - for( nPos = 1; nPos < argc; nPos++ ) + ptr = pszBuffer = ( char * ) hb_xgrab( ulLen ); + for( iArg = 1; iArg < argc; iArg++ ) { - hb_strncat( pszBuffer, argv[ nPos ], nLen ); - hb_strncat( pszBuffer, " ", nLen ); + ulLen = ( ULONG ) strlen( argv[ iArg ] ); + memcpy( ptr, argv[ iArg ], ulLen ); + ptr += ulLen; + *ptr++ = ' '; } + *--ptr = '\0'; /* Convert from OS codepage */ - hb_retc_buffer( ( char * ) hb_osDecode( ( BYTE * ) pszBuffer, &fFree ) ); - if( fFree ) - hb_xfree( pszBuffer ); + { + BOOL fFree; + hb_retc_buffer( ( char * ) hb_osDecode( ( BYTE * ) pszBuffer, &fFree ) ); + if( fFree ) + hb_xfree( pszBuffer ); + } } else hb_retc_null();