From 9b59f0675f92c2178df99cb37a715364a7882652 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 5 Nov 2005 23:26:23 +0000 Subject: [PATCH] + Fixed -o option git-svn-id: trunk@1669 - --- compiler/finput.pas | 6 +++++- compiler/options.pas | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/compiler/finput.pas b/compiler/finput.pas index c52925abb0..aa17f3fd6b 100644 --- a/compiler/finput.pas +++ b/compiler/finput.pas @@ -683,7 +683,11 @@ uses else p:=path^; sharedlibfilename:=stringdup(p+prefix+n+suffix+extension); - exefilename:=stringdup(p+n+target_info.exeext); + { don't use extension alone to check, it can be empty !! } + if (OutputFile<>'') or (OutputExtension<>'') then + exefilename:=stringdup(p+n+OutputExtension) + else + exefilename:=stringdup(p+n+target_info.exeext); mapfilename:=stringdup(p+n+'.map'); end; diff --git a/compiler/options.pas b/compiler/options.pas index ade924bce2..e866dbba1a 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -870,14 +870,15 @@ begin 'o' : begin if More<>'' then + begin {$IFDEF USE_SYSUTILS} - begin - d := SplitPath(More); - OutputFile := SplitFileName(More); - end + OutputExeDir:=SplitPath(More); + OutputFile:=SplitFileName(More); + OutputExtension:=SplitExtension(More); {$ELSE USE_SYSUTILS} - Fsplit(More,d,OutputFile,e) + FSplit(More,OutputExeDir,OutputFile,OutputExtension); {$ENDIF USE_SYSUTILS} + end else IllegalPara(opt); end;