diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ceb4e44015..aa956473d6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,22 @@ +20000321-01:10 GMT+1 Victor Szakats + + * source/rtl/gtapi.c + ! hb_gtBox() bottom/left corner draw bug fixed. Introduced around today. + + * source/rtl/diskspac.c + ! Fixed the default case for Win32. + + * source/rtl/getenv.c + ! Fixed to not modify the item buffer directly. + ! Fixed to convert the envvar name to uppercase on DOS and OS/2 platforms. + ! Consistent handling of \0 char in the envvar name. + ! Fixed stripping of the '=' character. + + * source/rtl/strings.c + source/rtl/stuff.c + source/rtl/word.c + - Superfluous #includes removed. + 20000320-22:30 GMT+1 Victor Szakats * samples/guestbk/bld_b32.bat diff --git a/harbour/source/rtl/diskspac.c b/harbour/source/rtl/diskspac.c index d6d06ff184..043ce18142 100644 --- a/harbour/source/rtl/diskspac.c +++ b/harbour/source/rtl/diskspac.c @@ -50,6 +50,7 @@ #include "hbapi.h" #include "hbapierr.h" +#include "hbapifs.h" #if defined(DOS) || defined(__WATCOMC__) #include @@ -89,6 +90,9 @@ HARBOUR HB_DISKSPACE( void ) DWORD dwNumberOfFreeClusters; DWORD dwTotalNumberOfClusters; + if( uiDrive == 0 ) + uiDrive = hb_fsCurDrv() + 1; + szPath[ 0 ] = uiDrive + 'A' - 1; szPath[ 1 ] = ':'; szPath[ 2 ] = '\\'; diff --git a/harbour/source/rtl/getenv.c b/harbour/source/rtl/getenv.c index 42740d6e95..fa2673fb97 100644 --- a/harbour/source/rtl/getenv.c +++ b/harbour/source/rtl/getenv.c @@ -57,24 +57,40 @@ HARBOUR HB_GETENV( void ) if( pName ) { - char * szName = hb_itemGetCPtr( pName ); - ULONG ulName = hb_itemGetCLen( pName ); + char * pszName = hb_itemGetC( pName ); + ULONG ulName = strlen( pszName ); + ULONG ulPos; - while( ulName && szName[ ulName - 1 ] == '=' ) + /* strip the '=' or else it will clear the variable! */ + + for( ulPos = 0; ulPos < ulName; ulPos++ ) { - /* strip the '=' or else it will clear the variable! */ - szName[ ulName - 1 ] = '\0'; - ulName--; + if( pszName[ ulPos ] == '=' ) + { + pszName[ ulPos ] = '\0'; + break; + } } - if( ulName ) + if( pszName[ 0 ] != '\0' ) { - char * szValue = getenv( szName ); + char * szValue; + + /* NOTE: Convert the envvar name to uppercase. This is required for + DOS and OS/2 systems. [vszakats] */ + + #if defined(HB_OS_DOS) || defined(HB_OS_OS2) + hb_strupr( pszName ); + #endif + + szValue = getenv( pszName ); hb_retc( szValue ? szValue : ( ( ISCHAR( 2 ) ? hb_parc( 2 ) : "" ) ) ); } else hb_retc( "" ); + + hb_itemFreeC( pszName ); } else hb_retc( "" ); diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 7c3b264b31..9d69ed1f43 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -244,7 +244,7 @@ USHORT hb_gtBox( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, B if( height > 1 && width > 1 ) { - hb_gtWriteAt( uiBottom, uiCol , pszBox + 6, sizeof( BYTE ) ); /* Bottom left corner */ + hb_gtWriteAt( uiBottom, uiLeft, pszBox + 6, sizeof( BYTE ) ); /* Bottom left corner */ uiCol = ( height > 1 ? uiLeft + 1 : uiLeft ); diff --git a/harbour/source/rtl/strings.c b/harbour/source/rtl/strings.c index 823a38f834..05dbac8362 100644 --- a/harbour/source/rtl/strings.c +++ b/harbour/source/rtl/strings.c @@ -51,8 +51,6 @@ #include #include "hbapi.h" -#include "hbapiitm.h" -#include "hbapierr.h" BOOL hb_strEmpty( const char * szText, ULONG ulLen ) { diff --git a/harbour/source/rtl/stuff.c b/harbour/source/rtl/stuff.c index 9bd4c7c5cd..053c13db3f 100644 --- a/harbour/source/rtl/stuff.c +++ b/harbour/source/rtl/stuff.c @@ -34,7 +34,6 @@ */ #include "hbapi.h" -#include "hbapiitm.h" /* replaces characters in a string */ HARBOUR HB_STUFF( void ) diff --git a/harbour/source/rtl/word.c b/harbour/source/rtl/word.c index 62a0272a83..d32e0ab9c9 100644 --- a/harbour/source/rtl/word.c +++ b/harbour/source/rtl/word.c @@ -35,7 +35,6 @@ #include "hbapi.h" #include "hbapierr.h" -#include "hbapiitm.h" /* NOTE: The Clipper NG states that WORD() will only work when used in CALL commands parameter list, otherwise it will return