From cfc7da6972bed5a8ec2d954b5c8761a6f1bdc4e4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 6 Jul 2010 10:29:14 +0000 Subject: [PATCH] 2010-07-06 12:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg ! Added strict parameter checking in sensitive places. --- harbour/ChangeLog | 6 +++++- harbour/utils/hbmk2/hbmk2.prg | 30 ++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 78e8e482d8..239ab8536d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,7 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ -2010-07-05 12:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) +2010-07-06 12:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + ! Added strict parameter checking in sensitive places. + +2010-07-06 12:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/hbmk2_plugin_qt.hbs + Return errors if required tools are not detected. (these errors are not yet all handled by hbmk2) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 9d9e13c63d..b6f4da58f9 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -6564,7 +6564,9 @@ FUNCTION hbmk2_ArrayToList( array, cSeparator ) LOCAL cString := "" LOCAL tmp - DEFAULT cSeparator TO " " + IF ! ISCHARACTER( cSeparator ) + cSeparator := " " + ENDIF FOR tmp := 1 TO Len( array ) cString += array[ tmp ] @@ -6806,7 +6808,9 @@ STATIC FUNCTION FindInPath( cFileName, cPath ) ENDIF ENDIF - DEFAULT cPath TO GetEnv( "PATH" ) + IF ! ISCHARACTER( cPath ) + cPath := GetEnv( "PATH" ) + ENDIF /* Check in the PATH. */ #if defined( __PLATFORM__WINDOWS ) .OR. ; @@ -7093,7 +7097,9 @@ STATIC FUNCTION PathNormalize( cPath, lNormalize ) IF ! Empty( cPath ) - DEFAULT lNormalize TO .T. + IF ! ISLOGICAL( lNormalize ) + lNormalize := .T. + ENDIF IF lNormalize @@ -7164,7 +7170,9 @@ STATIC FUNCTION PathMakeRelative( cPathBase, cPathTarget, lForceRelative ) LOCAL cTargetFileName - DEFAULT lForceRelative TO .F. + IF ! ISLOGICAL( lForceRelative ) + lForceRelative := .F. + ENDIF cPathBase := PathProc( DirAddPathSep( cPathBase ), hb_dirBase() ) cPathTarget := PathProc( cPathTarget, hb_dirBase() ) @@ -7262,7 +7270,9 @@ STATIC FUNCTION PathSepToSelf( cFileName, nStart ) STATIC FUNCTION PathSepToTarget( hbmk, cFileName, nStart ) - DEFAULT nStart TO 1 + IF ! ISNUMBER( nStart ) + nStart := 1 + ENDIF IF hbmk[ _HBMK_cPLAT ] $ "win|wce|dos|os2" .AND. !( hbmk[ _HBMK_cCOMP ] $ "mingw|mingw64|mingwarm|cygwin" ) RETURN Left( cFileName, nStart - 1 ) + StrTran( SubStr( cFileName, nStart ), "/", "\" ) @@ -7367,14 +7377,18 @@ STATIC FUNCTION DirUnbuild( cDir ) STATIC FUNCTION FN_Escape( cFileName, nEscapeMode, nFNNotation ) LOCAL cDir, cName, cExt, cDrive - DEFAULT nEscapeMode TO _ESC_NONE + IF ! ISNUMBER( nEscapeMode ) + nEscapeMode := _ESC_NONE + ENDIF + IF ! ISNUMBER( nFNNotation ) #if defined( __PLATFORM__WINDOWS ) .OR. ; defined( __PLATFORM__DOS ) .OR. ; defined( __PLATFORM__OS2 ) - DEFAULT nFNNotation TO _FNF_BCKSLASH + nFNNotation := _FNF_BCKSLASH #else - DEFAULT nFNNotation TO _FNF_FWDSLASH + nFNNotation := _FNF_FWDSLASH #endif + ENDIF SWITCH nFNNotation CASE _FNF_BCKSLASH