From 4cfb9a78b0cb682b642e940352a665a444b8f075 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 1 Feb 2013 00:35:52 +0000 Subject: [PATCH] 2013-02-01 01:30 UTC+0100 Viktor Szakats (harbour syenar.net) * bin/3rdpatch.hb * bin/commit.hb * contrib/hbblink/blinker.prg * contrib/hbxpp/runshell.prg * utils/hbmk2/hbmk2.prg % replaced hb_GetEnv() calls with GetEnv() where the Harbour extension parameter was not used * src/rtl/gete.c ! synced comment with reality * ChangeLog.txt + missed one fix from prev log entry --- harbour/ChangeLog.txt | 17 +++++++++++++++++ harbour/bin/3rdpatch.hb | 4 ++-- harbour/bin/commit.hb | 4 ++-- harbour/contrib/hbblink/blinker.prg | 4 ++-- harbour/contrib/hbxpp/runshell.prg | 6 +++--- harbour/src/rtl/gete.c | 8 ++------ harbour/utils/hbmk2/hbmk2.prg | 22 +++++++++++----------- 7 files changed, 39 insertions(+), 26 deletions(-) diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index eaa749736b..f7e7ecf7bc 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -10,11 +10,28 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-02-01 01:30 UTC+0100 Viktor Szakats (harbour syenar.net) + * bin/3rdpatch.hb + * bin/commit.hb + * contrib/hbblink/blinker.prg + * contrib/hbxpp/runshell.prg + * utils/hbmk2/hbmk2.prg + % replaced hb_GetEnv() calls with GetEnv() where the + Harbour extension parameter was not used + + * src/rtl/gete.c + ! synced comment with reality + + * ChangeLog.txt + + missed one fix from prev log entry + 2013-02-01 01:19 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbblink/blinker.prg * utils/hbmk2/hbmk2.prg * adapted to previous change + SWPRUNCMD() now returns .F. on error, like the original + ! SWPRUNCMD() fixed to run the shell itself if the passed + command was empty 2013-02-01 00:26 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/include/hbwinuni.h diff --git a/harbour/bin/3rdpatch.hb b/harbour/bin/3rdpatch.hb index 81dbc852a0..64b5f95fcb 100755 --- a/harbour/bin/3rdpatch.hb +++ b/harbour/bin/3rdpatch.hb @@ -557,7 +557,7 @@ STATIC PROCEDURE SetupTools() * Helps non-GNU userland systems with GNU tools installed. * Only several of the tools are known to have GNU variants. */ - FOR EACH cPathComp IN hb_ATokens( hb_GetEnv( "PATH" ), hb_osPathListSeparator() ) + FOR EACH cPathComp IN hb_ATokens( GetEnv( "PATH" ), hb_osPathListSeparator() ) FOR EACH cTool IN hb_HKeys( s_aTools ) IF cTool $ "patch|diff|tar" .AND. hb_FileExists( CombinePath( cPathComp, "g" + cTool ) + cExeExt ) s_aTools[ cTool ] := CombinePath( cPathComp, "g" + cTool ) @@ -565,7 +565,7 @@ STATIC PROCEDURE SetupTools() NEXT NEXT - FOR EACH cPathComp IN hb_ATokens( hb_GetEnv( "PATH" ), hb_osPathListSeparator() ) + FOR EACH cPathComp IN hb_ATokens( GetEnv( "PATH" ), hb_osPathListSeparator() ) FOR EACH cTool IN hb_HKeys( s_aTools ) IF s_aTools[ cTool ] == NIL .AND. hb_FileExists( CombinePath( cPathComp, cTool ) + cExeExt ) s_aTools[ cTool ] := CombinePath( cPathComp, cTool ) diff --git a/harbour/bin/commit.hb b/harbour/bin/commit.hb index 294ea9edac..8b62cc9e19 100644 --- a/harbour/bin/commit.hb +++ b/harbour/bin/commit.hb @@ -195,9 +195,9 @@ STATIC FUNCTION Shell() LOCAL cShell #if defined( __PLATFORM__UNIX ) - cShell := hb_GetEnv( "SHELL" ) + cShell := GetEnv( "SHELL" ) #else - cShell := hb_GetEnv( "COMSPEC" ) + cShell := GetEnv( "COMSPEC" ) #endif IF ! Empty( cShell ) diff --git a/harbour/contrib/hbblink/blinker.prg b/harbour/contrib/hbblink/blinker.prg index 9877090513..023590f62f 100644 --- a/harbour/contrib/hbblink/blinker.prg +++ b/harbour/contrib/hbblink/blinker.prg @@ -387,9 +387,9 @@ FUNCTION SwpRunCmd( cCommand, nMem, cRunPath, cTempPath ) IF Empty( cCommand ) #if defined( __PLATFORM__UNIX ) - cCommand := hb_GetEnv( "SHELL" ) + cCommand := GetEnv( "SHELL" ) #else - cCommand := hb_GetEnv( "COMSPEC" ) + cCommand := GetEnv( "COMSPEC" ) #endif ENDIF diff --git a/harbour/contrib/hbxpp/runshell.prg b/harbour/contrib/hbxpp/runshell.prg index 99d36ba10b..4338dca40d 100644 --- a/harbour/contrib/hbxpp/runshell.prg +++ b/harbour/contrib/hbxpp/runshell.prg @@ -57,11 +57,11 @@ FUNCTION RunShell( cCommand, cProgram, lAsync, lBackground ) IF ! HB_ISSTRING( cProgram ) #if defined( __PLATFORM__UNIX ) - cProgram := hb_GetEnv( "SHELL" ) + cProgram := GetEnv( "SHELL" ) #elif defined( __PLATFORM__OS2 ) - cProgram := hb_GetEnv( "OS2_SHELL" ) + cProgram := GetEnv( "OS2_SHELL" ) #else - cProgram := hb_GetEnv( "COMSPEC" ) + cProgram := GetEnv( "COMSPEC" ) #endif IF Empty( cProgram ) #if defined( __PLATFORM__WINDOWS ) diff --git a/harbour/src/rtl/gete.c b/harbour/src/rtl/gete.c index a8ee58a6f2..1453f81120 100644 --- a/harbour/src/rtl/gete.c +++ b/harbour/src/rtl/gete.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * GETENV(), GETE() functions + * GetEnv(), GetE() functions * * Copyright 1999 Matthew Hamilton * www - http://harbour-project.org @@ -55,7 +55,7 @@ * www - http://harbour-project.org * * Copyright 1999-2001 Viktor Szakats (harbour syenar.net) - * GETE() + * GetE() * * See COPYING.txt for licensing terms. * @@ -107,10 +107,6 @@ HB_FUNC_TRANSLATE( GETE, GETENV ) /* NOTE: Harbour extended version of GETENV(). The 2nd parameter can be used to specify a default value, returned if the requested envvar doesn't exist. - 3rd, optional logical parameter can specify whether to - apply automatic codepage conversion [ to the codepage - specified by Set( _SET_OSCODEPAGE ) ] onto the retrieved - envvar value. The default is .T. [vszakats] */ HB_FUNC( HB_GETENV ) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 8c9ec2ab9c..e00ab0a0a1 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -772,27 +772,27 @@ STATIC PROCEDURE hbmk_COMP_Setup( cARCH, cCOMP, cBasePath ) CASE cARCH == "dos" .AND. cCOMP == "djgpp" hb_SetEnv( "DJGPP", cBasePath + hb_ps() + "djgpp.env" ) - hb_SetEnv( "PATH", cBasePath + hb_ps() + "bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "bin" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) CASE cARCH == "win" .AND. cCOMP == "mingw" - hb_SetEnv( "PATH", cBasePath + hb_ps() + "bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "bin" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) CASE cARCH == "win" .AND. cCOMP == "pocc" - hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "Include" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Include" + hb_ps() + "Win" ) hb_SetEnv( "LIB", cBasePath + hb_ps() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Lib" + hb_ps() + "Win" ) CASE cARCH == "win" .AND. cCOMP == "pocc64" - hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "Include" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Include" + hb_ps() + "Win" ) hb_SetEnv( "LIB", cBasePath + hb_ps() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Lib" + hb_ps() + "Win64" ) CASE cARCH == "wce" .AND. cCOMP == "poccarm" - hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "Bin" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) hb_SetEnv( "INCLUDE", cBasePath + hb_ps() + "Include" + hb_ps() + "WinCE" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Include" ) hb_SetEnv( "LIB", cBasePath + hb_ps() + "Lib" + hb_osPathListSeparator() + cBasePath + hb_ps() + "Lib" + hb_ps() + "WinCE" ) @@ -802,13 +802,13 @@ STATIC PROCEDURE hbmk_COMP_Setup( cARCH, cCOMP, cBasePath ) hb_SetEnv( "EDPATH", cBasePath + hb_ps() + "eddat" ) #if defined( __PLATFORM__WINDOWS ) - hb_SetEnv( "PATH", cBasePath + hb_ps() + "binnt" + hb_osPathListSeparator() + cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binnt" + hb_osPathListSeparator() + cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) #elif defined( __PLATFORM__OS2 ) - hb_SetEnv( "PATH", cBasePath + hb_ps() + "binp" + hb_osPathListSeparator() + cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binp" + hb_osPathListSeparator() + cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) #elif defined( __PLATFORM__DOS ) - hb_SetEnv( "PATH", cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binw" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) #elif defined( __PLATFORM__LINUX ) - hb_SetEnv( "PATH", cBasePath + hb_ps() + "binl" + hb_osPathListSeparator() + hb_GetEnv( "PATH" ) ) + hb_SetEnv( "PATH", cBasePath + hb_ps() + "binl" + hb_osPathListSeparator() + GetEnv( "PATH" ) ) #endif DO CASE @@ -7274,9 +7274,9 @@ STATIC PROCEDURE ProcEnvOption( cValue ) IF ( tmp := At( "=", cValue ) ) > 1 hb_SetEnv( Left( cValue, tmp - 1 ), SubStr( cValue, tmp + 1 ) ) ELSEIF ( tmp := At( "+", cValue ) ) > 1 - hb_SetEnv( Left( cValue, tmp - 1 ), hb_GetEnv( Left( cValue, tmp - 1 ) ) + SubStr( cValue, tmp + 1 ) ) + hb_SetEnv( Left( cValue, tmp - 1 ), GetEnv( Left( cValue, tmp - 1 ) ) + SubStr( cValue, tmp + 1 ) ) ELSEIF ( tmp := At( "#", cValue ) ) > 1 - hb_SetEnv( Left( cValue, tmp - 1 ), SubStr( cValue, tmp + 1 ) + hb_GetEnv( Left( cValue, tmp - 1 ) ) ) + hb_SetEnv( Left( cValue, tmp - 1 ), SubStr( cValue, tmp + 1 ) + GetEnv( Left( cValue, tmp - 1 ) ) ) ELSEIF ( tmp := At( "-", cValue ) ) > 1 hb_SetEnv( Left( cValue, tmp - 1 ) ) ELSE