X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:reply-to:subject:to:references:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=Z43OTvpSyp0ygmnD
	uGrmHQyxUcgyVxG1e6Ml7IidSSyQxksMUKZ/o68V10yY5whIusUlAV5Cb37pk3U8
	B1Y5TnKKKHojkZyeedETveO7S99I7DFOtjICU0SI2bRRdZAPv2jGEyeCXAxe3G5L
	LSfWwheLdkVxm2utcOkMFCUSJyk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:reply-to:subject:to:references:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=rMdeM0FhjCw16aWSWMCHVm
	uV9nU=; b=tYgr6XI4EvOCuca1Lc4ZclsY3tVKWCPkkhAPKzrPao+kN9SlUJVenU
	kMFVzO+Q2OK2S1UzOV/wV4igUuda3UK8ZY8M5x/C/gN9GLAU0ugvciLiWavUq+3e
	cN0HNOosxgDsH7E+tT8dLNwbcuBXGchiJHgQ8zJySK6OvkJshGfHo=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=converted, H*R:D*ca
X-HELO: smtp-out-no.shaw.ca
X-Authority-Analysis: v=2.3 cv=MfVCRa3f c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=h-92_h3ziTI4TohkYS8A:9 a=QEXdDO2ut3YA:10
Reply-To: Brian.Inglis@SystematicSw.ab.ca
Subject: Re: Fails to launch batch script in some directories
To: cygwin@cygwin.com
References: <Alexpux/MSYS2-packages/issues/1225@github.com> <76873039-f459-5534-ce8a-bb8fcbd35274@gmail.com> <20180420131111.GS15911@calimero.vinschen.de>
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Message-ID: <2325202b-1fb7-dbc9-9738-8934d3949fcb@SystematicSw.ab.ca>
Date: Sat, 21 Apr 2018 09:38:55 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <20180420131111.GS15911@calimero.vinschen.de>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-CMAE-Envelope: MS4wfBisH7Ymysm7K+mPQuoKFJHoWe7ApUK2PzvSj/Y6WeAILuCnyZ2D1wqtpDE6E2sfu9EQo0RnDk67Cw2pr+1RH9iQ/iLf21/ZHB0eyBN52QPEvg8uap1N WxHgzilATU0YCYTeO3n1U4YHN40Y1eExRc624upYMtErHNWh/i633SliwxfYL4NwkCS7K5sMdEXvrA==
X-IsSubscribed: yes

On 2018-04-20 07:11, Corinna Vinschen wrote:
> On Apr 20 14:33, David Macek wrote:
>> Whoa, an interesting bug. I'm forwarding this to the Cygwin mailing list 
>> for reference. I might take a deeper look over the weekend if no-one beats
>> me to it.
>> It seems like running batch files (.bat, .cmd) inside a directory with an 
>> at sign and a space (such as '@ x' or 'x @') fails.
>> /w/temp/@ x$ ./hello.bat
>> 'W:\temp\@' is not recognized as an internal or external command, operable
>> program or batch file.
> Funny. That's very likely a bug in the @file handling in function 
> insert_file() in dcrt0.cc. This is basically stone-age old code to pamper
> starting Cygwin tools with too long commandl ines from cmd.
> I'm looking forward with what you're coming up with.

See my other post in this thread where strace shows @ handling is not involved,
as the script directory and name are normalized and converted to a win32 path
correctly, but child_info_spawn::worker does not appear to quote args with
spaces (or apostrophes) when building the command line, despite the comment near
the top of the function.
It is not clear where this quoting is expected to be done: it looks like
child_info_spawn::worker may do this itself when a script is invoked as
"cmd|command /c script" with argc == 3, but may be expecting a called function
to do this for other cases, as for a cmd script with no args and argc == 1.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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

