[MLton] Re: [MLton-commit] r6699
Matthew Fluet
fluet at tti-c.org
Mon Jun 15 08:21:44 PDT 2009
On Mon, 15 Jun 2009, Florian Weimer wrote:
>> The idea is that you enter single quote mode at the start and exit at the
>> end, but inside, any single quote is replaced by
>>
>> Single quote to exit single quote mode.
>> \' to actually add a single quote, backslash protected.
>> Single quote to re-enter single quote mode.
>>
>> I would be very surprised if the Cygwin shell didn't handle this correctly.
>
> It's not about the shell, it's about other Windows applications
> parsing the command line (I think).
It's about the Win32 spawn* functions (and possibly the CreateProcess
function), which provide fork/exec-like functionality.
The issue (as I understand it) is that the char **argv argument passed
to spawnv{,p}{,e} becomes the const char **argv argument passed to main
of the created process. One doesn't expect the contents of those character
arrays to be changed from spawn{,p}{,e} to main (that is, one shouldn't
need to do any escaping at all and one certainly doesn't need to for the
*nix exec{,p}{,e} functions), but there is some evidence that MinGW
does (or un-does?) escaping of the arguments.
More information about the MLton
mailing list