2013-06-04 20:25 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/pp/hbpp.c
! fixed memory leak due to unnecessary hb_strdup()
* respect UTC offset in HB_VER_REVID created from ChangeLog entry
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2013-06-04 20:25 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* src/pp/hbpp.c
|
||||
! fixed memory leak due to unnecessary hb_strdup()
|
||||
* respect UTC offset in HB_VER_REVID created from ChangeLog entry
|
||||
|
||||
2013-06-04 15:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* tests/mt/mttest10.prg
|
||||
+ allow to chose GT passing it's name as command line argument
|
||||
|
||||
@@ -575,7 +575,7 @@ static int hb_pp_parseChangelog( PHB_PP_STATE pState, const char * pszFileName,
|
||||
}
|
||||
else
|
||||
{
|
||||
char szRevID[ 11 ];
|
||||
char szRevID[ 18 ];
|
||||
|
||||
*szLine = '"';
|
||||
hb_strncpy( szLine + 1, szLog, sizeof( szLine ) - 3 );
|
||||
@@ -594,26 +594,56 @@ static int hb_pp_parseChangelog( PHB_PP_STATE pState, const char * pszFileName,
|
||||
|
||||
if( strlen( szLog ) >= 16 )
|
||||
{
|
||||
szRevID[ 0 ] = szLog[ 2 ];
|
||||
szRevID[ 1 ] = szLog[ 3 ];
|
||||
szRevID[ 2 ] = szLog[ 5 ];
|
||||
szRevID[ 3 ] = szLog[ 6 ];
|
||||
szRevID[ 4 ] = szLog[ 8 ];
|
||||
szRevID[ 5 ] = szLog[ 9 ];
|
||||
szRevID[ 6 ] = szLog[ 11 ];
|
||||
szRevID[ 7 ] = szLog[ 12 ];
|
||||
szRevID[ 8 ] = szLog[ 14 ];
|
||||
szRevID[ 9 ] = szLog[ 15 ];
|
||||
long lJulian = 0, lMilliSec = 0;
|
||||
int iUTC = 0;
|
||||
|
||||
if( strlen( szLog ) >= 25 && szLog[ 17 ] == 'U' &&
|
||||
szLog[ 18 ] == 'T' && szLog[ 19 ] == 'C' &&
|
||||
( szLog[ 20 ] == '+' || szLog[ 20 ] == '-' ) &&
|
||||
HB_ISDIGIT( szLog[ 21 ] ) && HB_ISDIGIT( szLog[ 22 ] ) &&
|
||||
HB_ISDIGIT( szLog[ 23 ] ) && HB_ISDIGIT( szLog[ 24 ] ) )
|
||||
{
|
||||
iUTC = ( ( int ) ( szLog[ 21 ] - '0' ) * 10 +
|
||||
( int ) ( szLog[ 22 ] - '0' ) ) * 60 +
|
||||
( int ) ( szLog[ 23 ] - '0' ) * 10 +
|
||||
( int ) ( szLog[ 24 ] - '0' );
|
||||
}
|
||||
szLog[ 16 ] = '\0';
|
||||
if( iUTC != 0 && hb_timeStampStrGetDT( szLog, &lJulian, &lMilliSec ) )
|
||||
{
|
||||
hb_timeStampUnpackDT( hb_timeStampPackDT( lJulian, lMilliSec ) -
|
||||
( double ) iUTC / ( 24 * 60 ),
|
||||
&lJulian, &lMilliSec );
|
||||
}
|
||||
if( lJulian && lMilliSec )
|
||||
{
|
||||
hb_timeStampStrRawPut( szRevID, lJulian, lMilliSec );
|
||||
memmove( szRevID, szRevID + 2, 10 );
|
||||
}
|
||||
else
|
||||
{
|
||||
szRevID[ 0 ] = szLog[ 2 ];
|
||||
szRevID[ 1 ] = szLog[ 3 ];
|
||||
szRevID[ 2 ] = szLog[ 5 ];
|
||||
szRevID[ 3 ] = szLog[ 6 ];
|
||||
szRevID[ 4 ] = szLog[ 8 ];
|
||||
szRevID[ 5 ] = szLog[ 9 ];
|
||||
szRevID[ 6 ] = szLog[ 11 ];
|
||||
szRevID[ 7 ] = szLog[ 12 ];
|
||||
szRevID[ 8 ] = szLog[ 14 ];
|
||||
szRevID[ 9 ] = szLog[ 15 ];
|
||||
}
|
||||
szRevID[ 10 ] = '\0';
|
||||
|
||||
}
|
||||
else
|
||||
szRevID[ 0 ] = '\0';
|
||||
|
||||
*piRevID = ( int ) hb_strValInt( szRevID, &iLen );
|
||||
|
||||
hb_pp_addDefine( pState, "HB_VER_REVID", hb_strdup( szRevID ) );
|
||||
hb_pp_addDefine( pState, "HB_VER_REVID", szRevID );
|
||||
#ifdef HB_LEGACY_LEVEL4
|
||||
hb_pp_addDefine( pState, "HB_VER_SVNID", hb_strdup( szRevID ) );
|
||||
hb_pp_addDefine( pState, "HB_VER_SVNID", szRevID );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user