This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bizarre Cygwin/Explorer/paths problem half-solved


On Fri, Aug 8, 2008 at 15:47, Tim McDaniel  wrote:
> On Fri, 8 Aug 2008, Christopher Faylor
> <cgf-use-the-mailinglist-please@cygwin.com> wrote:
>>
>> On Fri, Aug 08, 2008 at 01:58:12PM -0500, Tim McDaniel wrote:
>>>
>>> That's most unpleasant.  I don't suppose there's any way to control
>>> Cygwin's bash in re where to put double quotes around arguments
>>> being passed to a Windows command (since getting Microsoft to make
>>> explorer.exe be sane is hopeless)?  Except by not using characters
>>> that bash thinks need quoting.
>>
>> I'd be very surprised if bash was doing anything different for
>> Windows than it does for linux.  cygwin1.dll does do some quoting of
>> arguments to non-cygwin programs if it thinks it is required.
>
> Well, *something* had to be adding the double-quotes.  It's execve()
> and such adding them, then?

Yes. Windows doesn't have an argv array. Windows programs just get a
single string for their command line from CreateProcess(). It's up to
them how they parse it. Cygwin execv() turns
argv[]={"list","of","arguments with spaces or","not"} into
lpCommandLine="list of \"arguments with spaces or\" not".

Look in winf.cc linebuf::fromargv() . It's set up to work right for
the way cmd.exe parses command lines, with all it's stupid details.
But because each windows program gets to choose how to deal with
quoting and spaces, of course explorer.exe deals with them
differently.

Lev

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]