From c8acf19ab2bf5eeed9ebcc83fe050537d6a0f733 Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 23 Nov 2003 00:04:48 +0000 Subject: [PATCH] fixed adding default ext for programs under win32 git-svn-id: trunk@4829 - --- ide/compileroptions.pp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index a0d8b027a7..8f5ed37269 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -1383,16 +1383,23 @@ end; ------------------------------------------------------------------------------} function TBaseCompilerOptions.CreateTargetFilename( const MainSourceFileName: string): string; + + procedure AppendDefaultExt; + begin + if CompareText(fTargetOS, 'win32') = 0 then + Result:=Result+'.exe'; + end; + begin if (TargetFilename <> '') then begin Result:=ExtractFilePath(MainSourceFileName)+TargetFilename; + AppendDefaultExt; end else begin // fpc creates lowercase executables as default Result:=lowercase(ExtractFileNameOnly(MainSourceFileName)); if Result<>'' then begin Result:=ExtractFilePath(MainSourceFileName)+Result; - if CompareText(fTargetOS, 'win32') = 0 - then Result:=Result+'.exe'; + AppendDefaultExt; end else Result:=''; end;