2012-06-14 01:09 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbrun/hbrun.prg
  * utils/hbmk2/hbmk2.prg
    % minor optimization to not try to create ~/.harbour directory
      on each __hbrun_ConfigDir() call, only when saving there.
This commit is contained in:
Viktor Szakats
2012-06-13 23:13:24 +00:00
parent cda71d8c53
commit bd6343a4d3
3 changed files with 31 additions and 31 deletions

View File

@@ -16,6 +16,12 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-06-14 01:09 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbrun/hbrun.prg
* utils/hbmk2/hbmk2.prg
% minor optimization to not try to create ~/.harbour directory
on each __hbrun_ConfigDir() call, only when saving there.
2012-06-14 00:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/include/hbset.h
* harbour/src/vm/set.c

View File

@@ -701,7 +701,7 @@ STATIC PROCEDURE hbrun_Exec( cCommand )
LOCAL pHRB, cHRB, cFunc, bBlock, cEol, nRowMin
cEol := hb_eol()
cFunc := "STATIC FUNC __HBDOT()" + cEol + ;
cFunc := "STATIC FUNCTION __HBDOT()" + cEol + ;
"RETURN {||" + cEol + ;
" " + cCommand + cEol + ;
" RETURN __MVSETBASE()" + cEol + ;
@@ -740,6 +740,12 @@ STATIC FUNCTION HBRawVersion()
#define _HISTORY_DISABLE_LINE "no"
#if defined( __PLATFORM__DOS )
# define _FNAME_HISTORY_ "hbhist.ini"
#else
# define _FNAME_HISTORY_ ".hb_history"
#endif
STATIC PROCEDURE hbrun_HistoryLoad()
LOCAL cHistory
LOCAL cLine
@@ -747,7 +753,7 @@ STATIC PROCEDURE hbrun_HistoryLoad()
s_lWasLoad := .T.
IF s_lPreserveHistory
cHistory := StrTran( MemoRead( hbrun_HistoryFileName() ), Chr( 13 ) )
cHistory := StrTran( MemoRead( __hbrun_ConfigDir() + _FNAME_HISTORY_ ), Chr( 13 ) )
IF Left( cHistory, Len( _HISTORY_DISABLE_LINE + Chr( 10 ) ) ) == _HISTORY_DISABLE_LINE + Chr( 10 )
s_lPreserveHistory := .F.
ELSE
@@ -764,6 +770,7 @@ STATIC PROCEDURE hbrun_HistoryLoad()
STATIC PROCEDURE hbrun_HistorySave()
LOCAL cHistory
LOCAL cLine
LOCAL cDir
IF s_lWasLoad .AND. s_lPreserveHistory
cHistory := ""
@@ -772,22 +779,14 @@ STATIC PROCEDURE hbrun_HistorySave()
cHistory += AllTrim( cLine ) + hb_eol()
ENDIF
NEXT
hb_MemoWrit( hbrun_HistoryFileName(), cHistory )
IF ! hb_DirExists( cDir := __hbrun_ConfigDir() )
hb_DirCreate( cDir )
ENDIF
hb_MemoWrit( cDir + _FNAME_HISTORY_, cHistory )
ENDIF
RETURN
STATIC FUNCTION hbrun_HistoryFileName()
LOCAL cFileName
#if defined( __PLATFORM__DOS )
cFileName := "hbhist.ini"
#else
cFileName := ".hb_history"
#endif
RETURN __hbrun_ConfigDir() + cFileName
FUNCTION __hbrun_FindInPath( cFileName, xPath )
LOCAL cDir
LOCAL cName

View File

@@ -12305,10 +12305,6 @@ STATIC FUNCTION __hbrun_ConfigDir()
cDir := hb_DirBase()
ENDIF
IF ! hb_DirExists( cDir )
hb_DirCreate( cDir )
ENDIF
RETURN cDir + hb_ps()
STATIC PROCEDURE __hbrun_LoadExtDynamicFromFile( aDynamic, cFileName )
@@ -12820,6 +12816,12 @@ STATIC PROCEDURE __hbrun_Exec( cCommand )
#define _HISTORY_DISABLE_LINE "no"
#if defined( __PLATFORM__DOS )
# define _FNAME_HISTORY_ "hbhist.ini"
#else
# define _FNAME_HISTORY_ ".hb_history"
#endif
EXIT PROCEDURE __hbrun_exit()
__hbrun_HistorySave()
@@ -12833,7 +12835,7 @@ STATIC PROCEDURE __hbrun_HistoryLoad()
s_lWasLoad := .T.
IF s_lPreserveHistory
cHistory := StrTran( MemoRead( __hbrun_HistoryFileName() ), Chr( 13 ) )
cHistory := StrTran( MemoRead( __hbrun_ConfigDir() + _FNAME_HISTORY_ ), Chr( 13 ) )
IF Left( cHistory, Len( _HISTORY_DISABLE_LINE + Chr( 10 ) ) ) == _HISTORY_DISABLE_LINE + Chr( 10 )
s_lPreserveHistory := .F.
ELSE
@@ -12850,6 +12852,7 @@ STATIC PROCEDURE __hbrun_HistoryLoad()
STATIC PROCEDURE __hbrun_HistorySave()
LOCAL cHistory
LOCAL cLine
LOCAL cDir
IF s_lWasLoad .AND. s_lPreserveHistory
cHistory := ""
@@ -12858,22 +12861,14 @@ STATIC PROCEDURE __hbrun_HistorySave()
cHistory += AllTrim( cLine ) + hb_eol()
ENDIF
NEXT
hb_MemoWrit( __hbrun_HistoryFileName(), cHistory )
IF ! hb_DirExists( cDir := __hbrun_ConfigDir() )
hb_DirCreate( cDir )
ENDIF
hb_MemoWrit( cDir + _FNAME_HISTORY_, cHistory )
ENDIF
RETURN
STATIC FUNCTION __hbrun_HistoryFileName()
LOCAL cFileName
#if defined( __PLATFORM__DOS )
cFileName := "hbhist.ini"
#else
cFileName := ".hb_history"
#endif
RETURN __hbrun_ConfigDir() + cFileName
#if defined( __PLATFORM__WINDOWS )
/* NOTE: Using an optional contrib component. Relying on it dynamically. */