From e862e2e3db6f3d7344a16cb824b37ed0549b6c51 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 23 Apr 2010 17:13:16 +0000 Subject: [PATCH] 2010-04-23 19:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg ! Fixed path normalization to return '.' in case a non-empty path becomes an empty one after normalization. * Added extra protection to avoid '-I' option with empty parameter. --- harbour/ChangeLog | 7 +++++++ harbour/utils/hbmk2/hbmk2.prg | 24 +++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 16cd5e981c..35c55d1a91 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-23 19:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + ! Fixed path normalization to return '.' in case a + non-empty path becomes an empty one after normalization. + * Added extra protection to avoid '-I' option with empty + parameter. + 2010-04-23 14:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbcups/hbcups.c % Minor opt. diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index cb5a29a4fb..d064ef2256 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -3752,15 +3752,17 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IF ! lSkipBuild .AND. ! lStopAfterInit FOR EACH tmp IN hbmk[ _HBMK_aINCPATH ] - /* Different escaping for internal and external compiler. */ - IF hbmk[ _HBMK_nHBMODE ] == _HBMODE_NATIVE - AAdd( hbmk[ _HBMK_aOPTPRG ], "-i" + tmp ) - ELSE - AAdd( hbmk[ _HBMK_aOPTPRG ], "-i" + FN_Escape( tmp, nCmd_Esc ) ) - ENDIF - IF ! lStopAfterHarbour - AAdd( hbmk[ _HBMK_aOPTC ], StrTran( cOptIncMask, "{DI}", FN_Escape( tmp, nCmd_Esc ) ) ) - AAdd( hbmk[ _HBMK_aOPTRES ], StrTran( cOptIncMask, "{DI}", FN_Escape( tmp, nCmd_Esc ) ) ) + IF ! Empty( tmp ) + /* Different escaping for internal and external compiler. */ + IF hbmk[ _HBMK_nHBMODE ] == _HBMODE_NATIVE + AAdd( hbmk[ _HBMK_aOPTPRG ], "-i" + tmp ) + ELSE + AAdd( hbmk[ _HBMK_aOPTPRG ], "-i" + FN_Escape( tmp, nCmd_Esc ) ) + ENDIF + IF ! lStopAfterHarbour + AAdd( hbmk[ _HBMK_aOPTC ], StrTran( cOptIncMask, "{DI}", FN_Escape( tmp, nCmd_Esc ) ) ) + AAdd( hbmk[ _HBMK_aOPTRES ], StrTran( cOptIncMask, "{DI}", FN_Escape( tmp, nCmd_Esc ) ) ) + ENDIF ENDIF NEXT ENDIF @@ -6033,6 +6035,10 @@ STATIC FUNCTION PathNormalize( cPath, lNormalize ) ENDIF NEXT ENDIF + + IF Empty( cPath ) + cPath := "." + ENDIF ENDIF RETURN cPath