From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75334 invoked by alias); 21 Apr 2018 15:39:02 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 75325 invoked by uid 89); 21 Apr 2018 15:39:01 -0000 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 Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Apr 2018 15:38:58 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with ESMTP id 9ubHfF3eHXL8A9ubIfr8Wk; Sat, 21 Apr 2018 09:38:57 -0600 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: <76873039-f459-5534-ce8a-bb8fcbd35274@gmail.com> <20180420131111.GS15911@calimero.vinschen.de> From: Brian Inglis Message-ID: <2325202b-1fb7-dbc9-9738-8934d3949fcb@SystematicSw.ab.ca> Date: Sat, 21 Apr 2018 15:39:00 -0000 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 X-SW-Source: 2018-04/txt/msg00262.txt.bz2 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