diff --git a/ChangeLog.txt b/ChangeLog.txt index f322a2da11..27a5bcf248 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,14 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-07 13:07 UTC+0200 Viktor Szakats (harbour syenar.net) + * bin/check.hb + * tests/fixcase.hb + * minor cleanups + + * tests/fixcase.hb + + work regardless of cwd + 2013-04-07 12:49 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/check.hb * tests/fixcase.hb diff --git a/bin/check.hb b/bin/check.hb index f43f013285..ef66079279 100644 --- a/bin/check.hb +++ b/bin/check.hb @@ -788,12 +788,7 @@ STATIC FUNCTION FixFuncCase( cFileName ) cFile := MemoRead( _HBROOT_ + cFileName ) lPartial := hb_FNameExt( cFileName ) $ sc_hPartial - - IF lPartial - cFileStripped := GetCComments( cFile ) - ELSE - cFileStripped := cFile - ENDIF + cFileStripped := iif( lPartial, GetCComments( cFile ), cFile ) cOldCP := hb_cdpSelect( "EN" ) diff --git a/tests/fixcase.hb b/tests/fixcase.hb index cc77f52281..c976886d2a 100644 --- a/tests/fixcase.hb +++ b/tests/fixcase.hb @@ -17,15 +17,11 @@ #pragma -ko+ #include "directry.ch" -#include "simpleio.ch" + +#define _HBROOT_ hb_DirBase() + hb_DirSepToOS( "../" ) /* must end with dirsep */ PROCEDURE Main( cFile ) - LOCAL aFile - LOCAL cExt - - LOCAL hAll := { => } - STATIC sc_hExtExceptions := { ; ".dll" =>, ; ".dxe" =>, ; @@ -102,6 +98,12 @@ PROCEDURE Main( cFile ) "tests/multifnc/*" , ; "tests/rddtest/*" } + LOCAL aFile + LOCAL cExt + LOCAL cOldCWD + + LOCAL hAll := { => } + hb_cdpSelect( "EN" ) hb_HCaseMatch( hAll, .F. ) @@ -111,6 +113,7 @@ PROCEDURE Main( cFile ) IF HB_ISSTRING( cFile ) ProcFile( hAll, cFile ) ELSE + cOldCWD := hb_cwd( _HBROOT_ ) FOR EACH aFile IN hb_DirScan( "", hb_osFileMask() ) cExt := hb_FNameExt( aFile[ F_NAME ] ) IF ! Empty( cExt ) .AND. ; @@ -120,6 +123,7 @@ PROCEDURE Main( cFile ) ProcFile( hAll, aFile[ F_NAME ] ) ENDIF NEXT + hb_cwd( cOldCWD ) ENDIF RETURN @@ -142,12 +146,7 @@ STATIC PROCEDURE ProcFile( hAll, cFileName ) LOCAL nChanged := 0 lPartial := hb_FNameExt( cFileName ) $ sc_hPartial - - IF lPartial - cFileStripped := GetCComments( cFile ) - ELSE - cFileStripped := cFile - ENDIF + cFileStripped := iif( lPartial, GetCComments( cFile ), cFile ) #define _MATCH_cStr 1 #define _MATCH_nStart 2