2022-11-11 20:47 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* include/hbapi.h
  * src/common/hbver.c
  * src/main/harbour.c
  * src/pp/hbpp.c
  * src/rtl/version.c
  * src/vm/cmdarg.c
    ! fixed integer overflow in revision number calculated from
      the last ChangeLog entry date
This commit is contained in:
Przemysław Czerpak
2022-11-11 20:47:55 +01:00
parent 9796e3a16e
commit 580ee59412
7 changed files with 24 additions and 13 deletions

View File

@@ -7,6 +7,16 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */
2022-11-11 20:47 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapi.h
* src/common/hbver.c
* src/main/harbour.c
* src/pp/hbpp.c
* src/rtl/version.c
* src/vm/cmdarg.c
! fixed integer overflow in revision number calculated from
the last ChangeLog entry date
2022-11-07 09:24 UTC+0100 Aleksander Czajczynski (hb fki.pl)
* contrib/hbcurl/core.c
! CURLOPT_MAXLIFETIME_CONN is available in curl 7.80.0,

View File

@@ -1189,7 +1189,7 @@ extern HB_EXPORT char * hb_verHarbour( void ); /* retrieves a newl
extern HB_EXPORT char * hb_verPCode( void ); /* retrieves a newly allocated buffer containing PCode version */
extern HB_EXPORT char * hb_verBuildDate( void ); /* retrieves a newly allocated buffer containing build date and time */
extern HB_EXPORT void hb_verBuildInfo( void ); /* display harbour, compiler, and platform versions to standard console */
extern HB_EXPORT int hb_verRevision( void ); /* retrieves source repository revision number */
extern HB_EXPORT HB_MAXINT hb_verRevision( void ); /* retrieves source repository revision number */
extern HB_EXPORT const char * hb_verChangeLogID( void ); /* retrieves a static buffer containing ChangeLog ID string */
extern HB_EXPORT const char * hb_verChangeLogLastEntry( void ); /* retrieves a static buffer containing ChangeLog last entry string */
#if defined( HB_LEGACY_LEVEL4 )

View File

@@ -1338,7 +1338,7 @@ char * hb_verHarbour( void )
HB_TRACE( HB_TR_DEBUG, ( "hb_verHarbour()" ) );
pszVersion = ( char * ) hb_xgrab( 80 );
hb_snprintf( pszVersion, 80, "Harbour %d.%d.%d%s (r%d)",
hb_snprintf( pszVersion, 80, "Harbour %d.%d.%d%s (r%" PFHL "u)",
HB_VER_MAJOR, HB_VER_MINOR, HB_VER_RELEASE, HB_VER_STATUS,
hb_verRevision() );

View File

@@ -48,7 +48,7 @@
#include "hbverbld.h"
/* Source repository revision number */
int hb_verRevision( void )
HB_MAXINT hb_verRevision( void )
{
return HB_VER_REVID;
}

View File

@@ -50,7 +50,7 @@
#define _DEFAULT_ORIGIN_URL "https://harbour.github.io/"
int hb_verRevision( void )
HB_MAXINT hb_verRevision( void )
{
return 0;
}
@@ -321,7 +321,7 @@ static char * hb_pp_escapeString( char * szString )
}
static int hb_pp_generateVerInfo( char * szVerFile,
int iRevID,
HB_MAXINT nRevID,
char * szChangeLogID,
char * szLastEntry )
{
@@ -350,7 +350,7 @@ static int hb_pp_generateVerInfo( char * szVerFile,
" * and is covered by the same license as Harbour PP\n"
" */\n\n" );
fprintf( fout, "#define HB_VER_REVID %d\n", iRevID );
fprintf( fout, "#define HB_VER_REVID %" PFHL "u\n", nRevID );
if( szChangeLogID )
{
@@ -436,7 +436,7 @@ static char * hb_fsFileFind( const char * pszFileMask )
}
static int hb_pp_parseChangelog( PHB_PP_STATE pState, const char * pszFileName,
int iQuiet, int * piRevID,
int iQuiet, HB_MAXINT * pnRevID,
char ** pszChangeLogID, char ** pszLastEntry )
{
char * pszFree = NULL;
@@ -638,7 +638,7 @@ static int hb_pp_parseChangelog( PHB_PP_STATE pState, const char * pszFileName,
else
szRevID[ 0 ] = '\0';
*piRevID = ( int ) hb_strValInt( szRevID, &iLen );
*pnRevID = hb_strValInt( szRevID, &iLen );
hb_pp_addDefine( pState, "HB_VER_REVID", szRevID );
#ifdef HB_LEGACY_LEVEL4
@@ -679,7 +679,8 @@ int main( int argc, char * argv[] )
char * szStdCh = NULL, * szLogFile = NULL, * szInclude;
HB_BOOL fWrite = HB_FALSE, fChgLog = HB_FALSE;
char * szChangeLogID = NULL, * szLastEntry = NULL;
int iRevID = 0, iResult = 0, iQuiet = 0, i;
int iResult = 0, iQuiet = 0, i;
HB_MAXINT nRevID = 0;
char * szPPRuleFuncName = NULL;
PHB_PP_STATE pState;
@@ -829,13 +830,13 @@ int main( int argc, char * argv[] )
if( fChgLog )
iResult = hb_pp_parseChangelog( pState, szLogFile, iQuiet,
&iRevID, &szChangeLogID, &szLastEntry );
&nRevID, &szChangeLogID, &szLastEntry );
if( iResult == 0 )
iResult = hb_pp_preprocesfile( pState, szRuleFile, szPPRuleFuncName );
if( iResult == 0 && szVerFile )
iResult = hb_pp_generateVerInfo( szVerFile, iRevID,
iResult = hb_pp_generateVerInfo( szVerFile, nRevID,
szChangeLogID, szLastEntry );
if( iResult == 0 && hb_pp_errorCount( pState ) > 0 )
iResult = 1;

View File

@@ -72,7 +72,7 @@ HB_FUNC( HB_VERSION )
case HB_VERSION_MINOR: hb_retni( HB_VER_MINOR ); break;
case HB_VERSION_RELEASE: hb_retni( HB_VER_RELEASE ); break;
case HB_VERSION_STATUS: hb_retc_const( HB_VER_STATUS ); break;
case HB_VERSION_REVISION: hb_retni( hb_verRevision() ); break;
case HB_VERSION_REVISION: hb_retnint( hb_verRevision() ); break;
case HB_VERSION_CHANGELOG_LAST: hb_retc_const( hb_verChangeLogLastEntry() ); break;
case HB_VERSION_CHANGELOG_ID: hb_retc_const( hb_verChangeLogID() ); break;
case HB_VERSION_PCODE_VER: hb_retni( HB_PCODE_VER ); break;

View File

@@ -875,7 +875,7 @@ void hb_cmdargProcess( void )
}
/* Source repository revision number */
int hb_verRevision( void )
HB_MAXINT hb_verRevision( void )
{
return HB_VER_REVID;
}