From 47251f48dbbc03d9f59e86c0d7655fad6c6f35fa Mon Sep 17 00:00:00 2001 From: Maurilio Longo Date: Tue, 8 Aug 2000 10:15:44 +0000 Subject: [PATCH] 2000-08-08 12:11 GMT+2 Maurilio Longo --- harbour/ChangeLog | 6 ++++++ harbour/source/common/hbver.c | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 81d11f3df3..6d3aecee49 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +2000-08-08 12:11 GMT+2 Maurilio Longo + * source/common/hbver.c + ! fixed Operating System/2 version report (broken since it wasn't taking into account that from OS/2 3.x version + number is inside QSV_VERSION_MINOR and that QSV_ constants need to be decremented by one to + access correct values inside array. + 2000-08-08 02:00 UTC+0800 Ron Pinkas * source/compiler/harbour.c * Corrected display of errors statistics to use \r so that error count doen't appear connected to the last reported diff --git a/harbour/source/common/hbver.c b/harbour/source/common/hbver.c index 3200a1bdf9..ae7aef3bfb 100644 --- a/harbour/source/common/hbver.c +++ b/harbour/source/common/hbver.c @@ -156,12 +156,19 @@ char * hb_verPlatform( void ) { unsigned long aulQSV[ QSV_MAX ] = { 0 }; - APIRET rc = DosQuerySysInfo( 1L, QSV_MAX, ( void * ) aulQSV, sizeof( ULONG ) * QSV_MAX ); + APIRET rc; + + rc = DosQuerySysInfo( 1L, QSV_MAX, ( void * ) aulQSV, sizeof( ULONG ) * QSV_MAX ); if( rc == 0 ) - sprintf( pszPlatform, "OS/2 %ld.%02ld", - aulQSV[ QSV_VERSION_MAJOR ] / 10, - aulQSV[ QSV_VERSION_MINOR ] ); + /* is this OS/2 2.x ? */ + if (aulQSV[ QSV_VERSION_MINOR -1 ] < 30) + sprintf( pszPlatform, "OS/2 %d.%02d", + aulQSV[ QSV_VERSION_MAJOR -1 ] / 10, + aulQSV[ QSV_VERSION_MINOR -1 ] ); + else + sprintf( pszPlatform, "OS/2 %2.2f", + (float) aulQSV[ QSV_VERSION_MINOR -1 ] / 10); else sprintf( pszPlatform, "OS/2" ); }