diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 63c5683bb5..35a0871a46 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-02 12:10 UTC+0100 Viktor Szakats (harbour syenar.net) + * bin/find.hb + + added support for multiple symbols at one run, f.e.: + hbrun bin/find PRINTERPORTTONAME HB_EOL CLEAREOL + ! show .hbx filenames with native pathseps + + * src/rdd/dbfcdx/dbfcdx1.c + * src/rdd/dbfnsx/dbfnsx1.c + * src/rdd/hbsix/sxcompr.c + * src/rtl/gtpca/gtpca.c + * src/rtl/gtsln/gtsln.c + * src/rtl/gttrm/gttrm.c + * src/rtl/hblpp.c + * 'for( ; ; )' -> '{ ;; }' + 2012-11-01 18:12 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbxpp/xppopc.c * contrib/xhb/xcstr.prg diff --git a/harbour/bin/find.hb b/harbour/bin/find.hb index 4e2b113ca7..91d420ef72 100644 --- a/harbour/bin/find.hb +++ b/harbour/bin/find.hb @@ -28,37 +28,40 @@ #include "directry.ch" -PROCEDURE Main( cContains ) +PROCEDURE Main( ... ) - WalkDir( hb_DirBase() + ".." + hb_ps(), cContains ) + WalkDir( hb_DirBase() + ".." + hb_ps(), { ... } ) RETURN -STATIC PROCEDURE WalkDir( cDir, cContains ) +STATIC PROCEDURE WalkDir( cDir, aContains ) LOCAL aFile FOR EACH aFile IN Directory( cDir + hb_osFileMask(), "D" ) IF aFile[ F_NAME ] == "." .OR. aFile[ F_NAME ] == ".." ELSEIF "D" $ aFile[ F_ATTR ] - WalkDir( cDir + aFile[ F_NAME ] + hb_ps(), cContains ) + WalkDir( cDir + aFile[ F_NAME ] + hb_ps(), aContains ) ELSEIF hb_FNameExt( aFile[ F_NAME ] ) == ".hbx" - ProcessFile( cDir + aFile[ F_NAME ], cContains ) + ProcessFile( cDir + aFile[ F_NAME ], aContains ) ENDIF NEXT RETURN -STATIC PROCEDURE ProcessFile( cFileName, cContains ) +STATIC FUNCTION PathSepToSelf( cFileName ) + RETURN StrTran( cFileName, iif( hb_ps() == "\", "/", "\" ), hb_ps() ) + +STATIC PROCEDURE ProcessFile( cFileName, aContains ) LOCAL cDynamic LOCAL lFirst := .T. FOR EACH cDynamic IN __hb_extern_get_exception_list( cFileName ) - IF cContains == NIL .OR. Upper( cContains ) $ Upper( cDynamic ) + IF Empty( aContains ) .OR. AScan( aContains, {| tmp | Upper( tmp ) $ Upper( cDynamic ) } ) > 0 IF lFirst lFirst := .F. - OutStd( cFileName + hb_eol() ) + OutStd( PathSepToSelf( cFileName ) + hb_eol() ) ENDIF OutStd( " " + cDynamic + "()" + hb_eol() ) ENDIF diff --git a/harbour/src/rdd/dbfcdx/dbfcdx1.c b/harbour/src/rdd/dbfcdx/dbfcdx1.c index bd501ea6ce..e9e27d7ebb 100644 --- a/harbour/src/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/src/rdd/dbfcdx/dbfcdx1.c @@ -4365,7 +4365,7 @@ static void hb_cdxTagGoTop( LPCDXTAG pTag ) else hb_cdxTagKeyRead( pTag, TOP_RECORD ); - for( ; ; ) + for( ;; ) { if( pTag->CurKey->rec == 0 || pTag->TagEOF || ! hb_cdxBottomScope( pTag ) ) { @@ -4398,7 +4398,7 @@ static void hb_cdxTagGoBottom( LPCDXTAG pTag ) else hb_cdxTagKeyRead( pTag, BTTM_RECORD ); - for( ; ; ) + for( ;; ) { if( pTag->CurKey->rec == 0 || pTag->TagBOF || ! hb_cdxTopScope( pTag ) ) { diff --git a/harbour/src/rdd/dbfnsx/dbfnsx1.c b/harbour/src/rdd/dbfnsx/dbfnsx1.c index c640fe2a76..40fc80b551 100644 --- a/harbour/src/rdd/dbfnsx/dbfnsx1.c +++ b/harbour/src/rdd/dbfnsx/dbfnsx1.c @@ -1407,7 +1407,7 @@ static LPPAGEINFO hb_nsxPageGetBuffer( LPTAGINFO pTag, HB_ULONG ulPage ) else { HB_ULONG ul = pIndex->ulPageLast; - for( ; ; ) + for( ;; ) { if( ++ul >= pIndex->ulPagesDepth ) ul = 0; diff --git a/harbour/src/rdd/hbsix/sxcompr.c b/harbour/src/rdd/hbsix/sxcompr.c index 52a936da8b..f932a025ec 100644 --- a/harbour/src/rdd/hbsix/sxcompr.c +++ b/harbour/src/rdd/hbsix/sxcompr.c @@ -377,7 +377,7 @@ static void hb_LZSSxNodeInsert( PHB_LZSSX_COMPR pCompr, int r ) pCompr->right[ r ] = pCompr->left[ r ] = DUMMYNODE; pCompr->match_length = 0; - for( ; ; ) + for( ;; ) { if( cmp >= 0 ) { diff --git a/harbour/src/rtl/gtpca/gtpca.c b/harbour/src/rtl/gtpca/gtpca.c index 3c93d4ec86..97f54e10c6 100644 --- a/harbour/src/rtl/gtpca/gtpca.c +++ b/harbour/src/rtl/gtpca/gtpca.c @@ -248,7 +248,7 @@ static void hb_gt_pca_AnsiGetCurPos( int * iRow, int * iCol ) /* wait up to 2 seconds for answer */ end_timer = hb_dateMilliSeconds() + 2000; - for( ; ; ) + for( ;; ) { /* loking for cursor position in "\033[%d;%dR" */ while( j < n && rdbuf[ j ] != '\033' ) diff --git a/harbour/src/rtl/gtsln/gtsln.c b/harbour/src/rtl/gtsln/gtsln.c index 01f76adefb..688f12ec40 100644 --- a/harbour/src/rtl/gtsln/gtsln.c +++ b/harbour/src/rtl/gtsln/gtsln.c @@ -496,7 +496,7 @@ static int hb_sln_isUTF8( int iStdOut, int iStdIn ) n = j = x = y = 0; /* wait up to 2 seconds for answer */ end_timer = hb_dateMilliSeconds() + 2000; - for( ; ; ) + for( ;; ) { /* loking for cursor position in "\033[%d;%dR" */ while( j < n && rdbuf[ j ] != '\033' ) diff --git a/harbour/src/rtl/gttrm/gttrm.c b/harbour/src/rtl/gttrm/gttrm.c index 6bd1befa58..28026ef7ef 100644 --- a/harbour/src/rtl/gttrm/gttrm.c +++ b/harbour/src/rtl/gttrm/gttrm.c @@ -1913,7 +1913,7 @@ static HB_BOOL hb_gt_trm_AnsiGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iC /* wait up to 2 seconds for answer */ end_timer = hb_dateMilliSeconds() + 2000; - for( ; ; ) + for( ;; ) { /* loking for cursor position in "\033[%d;%dR" */ while( j < n && rdbuf[ j ] != '\033' ) diff --git a/harbour/src/rtl/hblpp.c b/harbour/src/rtl/hblpp.c index 96e33bd9e4..52f4629624 100644 --- a/harbour/src/rtl/hblpp.c +++ b/harbour/src/rtl/hblpp.c @@ -110,7 +110,7 @@ HB_BOOL hb_lppSend( PHB_LPP pSocket, const void * data, HB_SIZE len, HB_MAXINT t if( timeout > 0 ) nTime = ( HB_MAXINT ) hb_dateMilliSeconds() + timeout; - for( ; ; ) + for( ;; ) { if( pSocket->nSendLen - pSocket->nSendPos < ( HB_SIZE ) LONG_MAX ) lSend = ( long ) ( pSocket->nSendLen - pSocket->nSendPos ); @@ -156,7 +156,7 @@ HB_BOOL hb_lppRecv( PHB_LPP pSocket, void ** data, HB_SIZE * len, HB_MAXINT time if( timeout > 0 ) nTime = ( HB_MAXINT ) hb_dateMilliSeconds() + timeout; - for( ; ; ) + for( ;; ) { if( ! pSocket->fRecvHasSize ) {