From f69803bda95f7edbb463000a5a5687ea59a88eb7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 6 Jul 2009 22:45:59 +0000 Subject: [PATCH] 2009-07-07 00:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/utils/hbmk2/hbmk2.prg % use hb_processRun() to execute commands ! fixed typo in hb_pcount() verification in hbmk_run() --- harbour/ChangeLog | 5 +++ harbour/utils/hbmk2/hbmk2.prg | 60 ++--------------------------------- 2 files changed, 8 insertions(+), 57 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6c65fde497..d7cc3bfd88 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-07 00:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/utils/hbmk2/hbmk2.prg + % use hb_processRun() to execute commands + ! fixed typo in hb_pcount() verification in hbmk_run() + 2009-07-07 00:18 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gttrm/gttrm.c ! do not catch SIGCHLD diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 4b5bb60bfb..ca7927bd63 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -418,66 +418,12 @@ PROCEDURE Main( ... ) #endif STATIC FUNCTION hbmk_run( hbmk, cCmd, cStdOut ) -#if defined( __PLATFORM__DOS ) - LOCAL nResult - LOCAL hFile - LOCAL cFileName - IF PCount() >= 2 - hFile := hb_FTempCreateEx( @cFileName ) - IF hFile != F_ERROR - FClose( hFile ) - cCmd += ">" + cFileName - nResult := hb_run( cCmd ) - cStdOut := hb_MemoRead( cFileName ) - FErase( cFileName ) - ELSE - nResult := -1 - cStdOut := "" - hbmk_OutErr( hbmk, I_( "Error: Cannot create temporary file." ) ) - ENDIF - RETURN nResult - ENDIF - RETURN hb_run( cCmd ) -#else - LOCAL hStdOut - LOCAL h - LOCAL result HB_SYMBOL_UNUSED( hbmk ) - - IF PCount() >= 2 - h := hb_ProcessOpen( cCmd,, @hStdOut ) - ELSE - h := hb_ProcessOpen( cCmd ) + IF PCount() >= 3 + RETURN hb_processRun( cCmd,, @cStdOut ) ENDIF - IF h != F_ERROR - IF PCount() >= 2 - cStdOut := hbmk_ReadHnd( hStdOut ) - ENDIF - result := hb_ProcessValue( h ) - hb_ProcessClose( h, .T. ) - IF PCount() >= 2 - FClose( hStdOut ) - ENDIF - ELSE - result := -1 - IF PCount() >= 2 - cStdOut := "" - ENDIF - ENDIF - RETURN result - -STATIC FUNCTION hbmk_ReadHnd( hFile ) - LOCAL cBuffer := Space( 4096 ) - LOCAL cString := "" - LOCAL nLen - - DO WHILE ( nLen := FRead( hFile, @cBuffer, Len( cBuffer ) ) ) > 0 - cString += Left( cBuffer, nLen ) - ENDDO - - RETURN cString -#endif + RETURN hb_processRun( cCmd ) STATIC PROCEDURE hbmk_COMP_Setup( cARCH, cCOMP, cBasePath )