Commit 47fb404b authored by John van Groningen's avatar John van Groningen
Browse files

don't add .exe if the file name already ends with .exe

parent 813e1cf9
...@@ -40,10 +40,17 @@ MakeObjPathname processor name ...@@ -40,10 +40,17 @@ MakeObjPathname processor name
MakeProjectPathname :: !String -> Pathname; MakeProjectPathname :: !String -> Pathname;
MakeProjectPathname name = RemoveSuffix name +++ ".prj"; MakeProjectPathname name = RemoveSuffix name +++ ".prj";
add_dot_exe_if_necessary :: !{#Char} -> {#Char};
add_dot_exe_if_necessary module_name
# i=size module_name-4;
| i>=0 && module_name.[i]=='.' && module_name.[i+1]=='e' && module_name.[i+2]=='x' && module_name.[i+3]=='e'
= module_name;
= module_name+++".exe";
MakeExecPathname :: !String -> Pathname; MakeExecPathname :: !String -> Pathname;
MakeExecPathname name MakeExecPathname name
= PlatformDependant = PlatformDependant
(RemoveSuffix name+++".exe") // Win (add_dot_exe_if_necessary (RemoveSuffix name)) // Win
(RemoveSuffix name) // Mac (RemoveSuffix name) // Mac
MakeSystemPathname :: !Pathname -> Pathname; MakeSystemPathname :: !Pathname -> Pathname;
...@@ -236,7 +243,7 @@ convert_exec_path_separators_and_extension path ...@@ -236,7 +243,7 @@ convert_exec_path_separators_and_extension path
| separator==DirSeparator | separator==DirSeparator
= path = path
| DirSeparator=='\\' | DirSeparator=='\\'
= path+++".exe" = add_dot_exe_if_necessary path
| separator=='\\' | separator=='\\'
# l=size path # l=size path
| l>4 && path.[l-4]=='.' | l>4 && path.[l-4]=='.'
......
...@@ -102,8 +102,8 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio ...@@ -102,8 +102,8 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
= { PR_InitProject = { PR_InitProject
& saved = False & saved = False
, exec = False , exec = False
, execpath = PlatformDependant //MakeExecPathname main_module_file_name , execpath = PlatformDependant
("{Project}"+++DirSeparatorString+++modname+++".exe") // Win ("{Project}"+++DirSeparatorString+++add_dot_exe_if_necessary modname) // Win
("{Project}"+++DirSeparatorString+++modname) // Mac ("{Project}"+++DirSeparatorString+++modname) // Mac
, inflist = , inflist =
{ mn = modname { mn = modname
...@@ -125,6 +125,13 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio ...@@ -125,6 +125,13 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
, root_directory = dirname , root_directory = dirname
} }
add_dot_exe_if_necessary :: !{#Char} -> {#Char};
add_dot_exe_if_necessary module_name
# i=size module_name-4;
| i>=0 && module_name.[i]=='.' && module_name.[i+1]=='e' && module_name.[i+2]=='x' && module_name.[i+3]=='e'
= module_name;
= module_name+++".exe";
PR_SetBuilt :: ![!ModuleDirAndName] !u:Project -> u:Project; PR_SetBuilt :: ![!ModuleDirAndName] !u:Project -> u:Project;
PR_SetBuilt used project=:{inflist=Nil} PR_SetBuilt used project=:{inflist=Nil}
= project; = project;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment