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

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

parent 813e1cf9
......@@ -40,10 +40,17 @@ MakeObjPathname processor name
MakeProjectPathname :: !String -> Pathname;
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 name
= PlatformDependant
(RemoveSuffix name+++".exe") // Win
(add_dot_exe_if_necessary (RemoveSuffix name)) // Win
(RemoveSuffix name) // Mac
MakeSystemPathname :: !Pathname -> Pathname;
......@@ -236,7 +243,7 @@ convert_exec_path_separators_and_extension path
| separator==DirSeparator
= path
| DirSeparator=='\\'
= path+++".exe"
= add_dot_exe_if_necessary path
| separator=='\\'
# l=size path
| l>4 && path.[l-4]=='.'
......
......@@ -102,8 +102,8 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
= { PR_InitProject
& saved = False
, exec = False
, execpath = PlatformDependant //MakeExecPathname main_module_file_name
("{Project}"+++DirSeparatorString+++modname+++".exe") // Win
, execpath = PlatformDependant
("{Project}"+++DirSeparatorString+++add_dot_exe_if_necessary modname) // Win
("{Project}"+++DirSeparatorString+++modname) // Mac
, inflist =
{ mn = modname
......@@ -125,6 +125,13 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
, 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 used project=:{inflist=Nil}
= 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