2013-04-07 12:49 UTC+0200 Viktor Szakats (harbour syenar.net)

* bin/check.hb
  * tests/fixcase.hb
    ! fixed another loop of regexp search and replace to only
      change exactly the item it found. It will fix some
      weird cases experienced in the past,
      f.e. in extras/httpsrv/uhttpd.prg
This commit is contained in:
Viktor Szakats
2013-04-07 12:51:26 +02:00
parent e41b82be36
commit 15cea3807f
3 changed files with 18 additions and 10 deletions

View File

@@ -10,6 +10,14 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2013-04-07 12:49 UTC+0200 Viktor Szakats (harbour syenar.net)
* bin/check.hb
* tests/fixcase.hb
! fixed another loop of regexp search and replace to only
change exactly the item it found. It will fix some
weird cases experienced in the past,
f.e. in extras/httpsrv/uhttpd.prg
2013-04-07 10:59 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/Makefile
! do not ignore failures in contribs in GNU Make build process

View File

@@ -817,11 +817,11 @@ STATIC FUNCTION FixFuncCase( cFileName )
NEXT
IF !( "hbclass.ch" $ cFileName ) .AND. ! lPartial
FOR EACH match IN hb_regexAll( "(?:REQUEST|EXTERNAL|EXTERNA|EXTERN)[ \t]+([A-Za-z_][A-Za-z0-9_]+)", cFile,,,,, .T. )
cProper := ProperCase( hAll, match[ 2 ] )
IF !( cProper == match[ 2 ] )
cFile := StrTran( cFile, match[ 1 ], StrTran( match[ 1 ], match[ 2 ], cProper ) )
OutStd( cFileName, match[ 2 ], cProper, "|" + match[ 1 ] + "|" + hb_eol() )
FOR EACH match IN hb_regexAll( "(?:REQUEST|EXTERNAL|EXTERNA|EXTERN)[ \t]+([A-Za-z_][A-Za-z0-9_]+)", cFile,,,,, .F. )
cProper := ProperCase( hAll, match[ 2 ][ _MATCH_cStr ] )
IF !( cProper == match[ 2 ][ _MATCH_cStr ] )
cFile := Left( cFile, match[ 2 ][ _MATCH_nStart ] - 1 ) + cProper + SubStr( cFile, match[ 2 ][ _MATCH_nEnd ] + 1 )
OutStd( cFileName, match[ 2 ][ _MATCH_cStr ], cProper, "|" + match[ 1 ][ _MATCH_cStr ] + "|" + hb_eol() )
nChanged++
ENDIF
NEXT

View File

@@ -169,11 +169,11 @@ STATIC PROCEDURE ProcFile( hAll, cFileName )
NEXT
IF !( "hbclass.ch" $ cFileName ) .AND. ! lPartial
FOR EACH match IN hb_regexAll( "(?:REQUEST|EXTERNAL|EXTERNA|EXTERN)[ \t]+([A-Za-z_][A-Za-z0-9_]+)", cFile,,,,, .T. )
cProper := ProperCase( hAll, match[ 2 ] )
IF !( cProper == match[ 2 ] )
cFile := StrTran( cFile, match[ 1 ], StrTran( match[ 1 ], match[ 2 ], cProper ) )
? cFileName, match[ 2 ], cProper, "|" + match[ 1 ] + "|"
FOR EACH match IN hb_regexAll( "(?:REQUEST|EXTERNAL|EXTERNA|EXTERN)[ \t]+([A-Za-z_][A-Za-z0-9_]+)", cFile,,,,, .F. )
cProper := ProperCase( hAll, match[ 2 ][ _MATCH_cStr ] )
IF !( cProper == match[ 2 ][ _MATCH_cStr ] )
cFile := Left( cFile, match[ 2 ][ _MATCH_nStart ] - 1 ) + cProper + SubStr( cFile, match[ 2 ][ _MATCH_nEnd ] + 1 )
OutStd( cFileName, match[ 2 ][ _MATCH_cStr ], cProper, "|" + match[ 1 ][ _MATCH_cStr ] + "|" + hb_eol() )
nChanged++
ENDIF
NEXT