delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/08/16:08:59

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <ba40711f0808081308g61108b14i78d27c14cc2ff6b9@mail.gmail.com>
Date: Fri, 8 Aug 2008 16:08:17 -0400
From: "Lev Bishop" <lev DOT bishop AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bizarre Cygwin/Explorer/paths problem half-solved
In-Reply-To: <Pine.NEB.4.64.0808081440200.1883@panix2.panix.com>
MIME-Version: 1.0
References: <20080808064144 DOT 94C9485E51 AT pessard DOT research DOT canon DOT com DOT au> <Pine DOT NEB DOT 4 DOT 64 DOT 0808081010250 DOT 2416 AT panix1 DOT panix DOT com> <20080808162840 DOT GA31347 AT ednor DOT casa DOT cgf DOT cx> <ba40711f0808081039n5d6cded1sa0744d8ab4b0c088 AT mail DOT gmail DOT com> <Pine DOT NEB DOT 4 DOT 64 DOT 0808081315200 DOT 7241 AT panix1 DOT panix DOT com> <20080808192948 DOT GB31846 AT ednor DOT casa DOT cgf DOT cx> <Pine DOT NEB DOT 4 DOT 64 DOT 0808081440200 DOT 1883 AT panix2 DOT panix DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Fri, Aug 8, 2008 at 15:47, Tim McDaniel  wrote:
> On Fri, 8 Aug 2008, Christopher Faylor
> <cgf-use-the-mailinglist-please AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019