www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/08/02/01:03:00

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 57252xJ9255075
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 57252xJ9255075
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=F9R3ZC/7
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 940A23858407
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1754110977;
bh=5VFIKbdbMbDetYMv9SHbU7zxvQXtp+V11oHPSNdweHY=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=F9R3ZC/7WusGhNGD+s6Sh9Rk9CaxhGUksRIw5f3ILHcDbtyxO/mvdVmNa6tLVXSMy
To+6tD27D+Zqg1gQ7lK8Ea5kqsLthjHEhXfPNTZpfAR2aowpwI9rxIVTwQ7rGU8H5+
SoJwxYVPkagup7jpR49LX1ejPVvEgOde/yoYibMk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1DB8B3858D1E
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1DB8B3858D1E
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1754110916; cv=none;
b=cnacIPxFwTvXzODz0aX+x+glOlC9KAFvfhdrzJ9rSBi641J+D4jCibBe9oeA6g512pkefhYLicoDSLc3EOFAaeToqWOIwHvSPW1lyfk3n5qqA8bnOmfChZcmdTFB0OhTt58SOXQOwSr4yuboNjEnIl9Aj84va6Z0NISk6GVZnxs=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1754110916; c=relaxed/simple;
bh=MqRsufUvoTNbCDOPXoKVTdqvC7ik7AqKNnCTOg+aGU8=;
h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
b=B7fs25rsF5e04t1ezGA7O0zLL1TAKQW2V3VufE7eGvVf/+LKVmuGG6kc6tMdYmUPLZwI85GPz5hN5YLYW7tG4QTI2TzuDK2M/vZFC3ke2O58ZeBBzDpH2a1ATzbA6NVBkHS0G6oysVrG9FoCS9TYeBvxpMY6jt4KNEE+FBSkTt0=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DB8B3858D1E
Date: Sat, 2 Aug 2025 14:01:51 +0900
To: cygwin AT cygwin DOT com
Subject: Re: Incorrect command line handling when launching Cygwin program
from Windows
Message-Id: <20250802140151.674d96f806911c2db06c88cb@nifty.ne.jp>
In-Reply-To: <AS8PR03MB7539945DA4EFCF7604405E378D26A@AS8PR03MB7539.eurprd03.prod.outlook.com>
References: <AS8PR03MB7539A2A8333F01580829C8DB8D27A AT AS8PR03MB7539 DOT eurprd03 DOT prod DOT outlook DOT com>
<20250801224236 DOT d52cdaf32913054e21711a12 AT nifty DOT ne DOT jp>
<AS8PR03MB7539945DA4EFCF7604405E378D26A AT AS8PR03MB7539 DOT eurprd03 DOT prod DOT outlook DOT com>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Fri, 1 Aug 2025 15:34:16 +0000
"Old, Oliver" wrote:
> > >echo-win32.exe C:\"Program Files"\
> > echo-win32.exe
> > C:"Program
> > Files\
> >
> > Is this as you expected?
> >
> > >echo.exe C:\"Program Files"\
> > echo
> > C:\Program Files\
> >
> > This makes more sense to me.
> 
> That is as expected. It is the way a Windows program would split the
> command line. To me, it does not make sense that Cygwin programs process
> the command line, which was produced by a Windows program, in a manner
> which is inconsistent with how a Windows program would.
> 
> If the sole purpose of taking a Windows command line is being able to be
> called from a Windows program, how does it make sense to diverge from
> Windows' parsing logic, aside from handling at-files?

So, shouldn't you be complaining abount PowerShell as well?
PS C:\> .\echo-win32.exe C:\"Program Files"\
C:\echo-win32.exe
C:\Program Files"
PS C:\> .\echo-win32.exe a b\"c\" d
a
b\c\
d

Moreover, you might complain about bash:
$ ./echo.exe C:\Windows\System32 '"' '\'
./a
C:WindowsSystem32
"
\

> ./echo-win32.exe C:\Windows\System32 '"' '\'
echo-win32.exe
C:\Windows\System32
'' '\'

cygwin does not treat \ as a quote if it is passed from non-cygwin shell.
When a Cygwin program is launched from a non-Cygwin shell, I personally
find it more natural for it to follow quoting semantics similar to Bash.

I'm afraid that's not the case...

> It sadly breaks builds driven by Windows-native tools since they expect
> the standard command line handling.

Isn't that the responsibility of the "Windows-native tool"? If it invokes
cygwin build tool, it should pass the arguments in a way that conforms to
cygwin's conventions.

BTW, what exactly is the "Windows-native tool"?

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

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

- Raw text -


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