[MLton-commit] r7168
Matthew Fluet
fluet at mlton.org
Wed Jun 17 15:39:00 PDT 2009
None of this auto-appending '.exe' nonsense --- you ask for a path,
you get the path. More importantly, a MLton generated executable (by
default) has no '.exe' extension; this was making it impossible to
MLton.Process.create a MLton generated executable --- in particular, a
MLton generated executable couldn't invoke itself with
CommandLine.name().
----------------------------------------------------------------------
U mlton/trunk/basis-library/mlton/process.sml
U mlton/trunk/basis-library/platform/cygwin.sml
----------------------------------------------------------------------
Modified: mlton/trunk/basis-library/mlton/process.sml
===================================================================
--- mlton/trunk/basis-library/mlton/process.sml 2009-06-17 22:21:47 UTC (rev 7167)
+++ mlton/trunk/basis-library/mlton/process.sml 2009-06-17 22:38:59 UTC (rev 7168)
@@ -330,7 +330,7 @@
open MLton.Platform.OS
in
case host of
- Cygwin => Cygwin.toExe path
+ Cygwin => Cygwin.toFullWindowsPath path
| MinGW => path
| _ => raise Fail "MLton.Process.launchWithCreate: path'"
end)
Modified: mlton/trunk/basis-library/platform/cygwin.sml
===================================================================
--- mlton/trunk/basis-library/platform/cygwin.sml 2009-06-17 22:21:47 UTC (rev 7167)
+++ mlton/trunk/basis-library/platform/cygwin.sml 2009-06-17 22:38:59 UTC (rev 7168)
@@ -1,4 +1,5 @@
-(* Copyright (C) 2004-2006, 2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 2004-2006, 2008 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
*
* MLton is released under a BSD-style license.
@@ -10,28 +11,4 @@
fun toFullWindowsPath p =
CUtil.C_String.toString
(PrimitiveFFI.Cygwin.toFullWindowsPath (NullString.nullTerm p))
-
- fun toExe cmd =
- let
- val cmd = toFullWindowsPath cmd
- fun addExe () = concat [cmd, ".exe"]
- fun loop i =
- let
- val i = i - 1
- in
- if i < 0 then
- addExe ()
- else
- let
- val c = String.sub (cmd, i)
- in
- case c of
- #"." => cmd
- | #"\\" => addExe ()
- | _ => loop i
- end
- end
- in
- loop (size cmd)
- end
end
More information about the MLton-commit
mailing list