diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 32057fd5cf..46e484c840 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2001-12-11 14:30 UTC+0100 Maurilio Longo + * source/common/Makefile + + added hbgete.c entry + * source/common/hbgete.c + + added OS/2 specific code + 2001-12-11 00:02 UTC+0100 Viktor Szakats + ChangeLog @@ -21,7 +27,7 @@ * source/vm/hvm.c * makefile.bc * makefile.vc - ! Removed assembler parts. TASM is no longer required to + ! Removed assembler parts. TASM is no longer required to build Harbour. - source/common/hash.c @@ -36,14 +42,14 @@ * source/common/Makefile * makefile.vc * makefile.bc - ! File handle tweaking functions moved to a separate + ! File handle tweaking functions moved to a separate source file. * source/common/hbgete.c * Some tweaks. * source/vm/hvm.c - - Removed some line not needed anymore, related to + - Removed some line not needed anymore, related to Windows exception handler. * source/vm/estack.c @@ -51,11 +57,11 @@ * makefile.bc * makefile.vc - + Added note to not modify these files to add + + Added note to not modify these files to add optional command line switches. * makefile.bc - - Removed explicit debug switches from on PDF + - Removed explicit debug switches from on PDF related file and from the 16 bit branch. 2001-12-10 19:55 GMT+1 Antonio Linares diff --git a/harbour/source/common/Makefile b/harbour/source/common/Makefile index dcb4c7db06..d965636a66 100644 --- a/harbour/source/common/Makefile +++ b/harbour/source/common/Makefile @@ -7,6 +7,7 @@ ROOT = ../../ C_SOURCES=\ hbfhnd.c \ hbfsapi.c \ + hbgete.c \ hbhash.c \ hbstr.c \ hbtrace.c \ diff --git a/harbour/source/common/hbgete.c b/harbour/source/common/hbgete.c index 8e586520a3..032dd2d52c 100644 --- a/harbour/source/common/hbgete.c +++ b/harbour/source/common/hbgete.c @@ -53,6 +53,9 @@ /* NOTE: Notice that this code is needed as ANSI C getenv() crashes so badly when used from a Windows DLL. */ +/* For OS/2 */ +#define INCL_DOSMISC + #define HB_OS_WIN_32_USED #include "hbapi.h" @@ -68,10 +71,27 @@ char * hb_getenv( const char * name ) if( nSize == 0 ) pszBuffer[ 0 ] = '\0'; + else GetEnvironmentVariable( name, pszBuffer, nSize ); } + +#elif defined(HB_OS_OS2) + + { + PSZ EnvValue = ""; + ULONG ulrc = DosScanEnv(name, &EnvValue); + + if (ulrc == NO_ERROR) { + strcpy( pszBuffer, (char *) EnvValue ); + + } else { + pszBuffer[ 0 ] = '\0'; + + } + } + #else {