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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=amxVG+mF1srfe6dB69cyByp80tqudcVbhy5MoNAggpS
	ZjuTVD4K6yveSqQd5CTCQ4XyrPcDwKRt7S3lv+B2g7Y3qP2qZfGl8URDrgKLj1Dc
	OAJpDfisQw+OTyaeGR/j64ZwyjWu2/bKbmI8diLqMt5ymdd5xRotv9YcSh7vdCy8
	=
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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=RfsfyiH7WcjEqICSqsD6xv5ZLkc=; b=E0yab2LV55mvkYyMG
	oclnVdSrDUNH/yL8WrpIJYPlAGzEbzr3ek1eD1ZZN2nWL8UaZXXU+gY1THjvrp3o
	QCxynq29BBYyBj3j47cVuzoZDoS7nSINJWn3sGHnW68AmxY6vlcTMo6sSje9p4ad
	oKAXz7YJgkOXtWK4iedFJkrbeg=
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
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS,TW_YG autolearn=no version=3.3.1
Message-ID: <51E6A3DB.7050605@cwilson.fastmail.fm>
Date: Wed, 17 Jul 2013 10:02:03 -0400
From: Charles Wilson <cygwin@cwilson.fastmail.fm>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
MIME-Version: 1.0
To: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Issue with run.exe and PWD with spaces since last update (Cygwin 1.7.21)
References: <295777180.20130716202913@mtu-net.ru> <20130717125916.GB21347@calimero.vinschen.de> <51E69DE2.10008@cwilson.fastmail.fm> <20130717134532.GC32258@calimero.vinschen.de>
In-Reply-To: <20130717134532.GC32258@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 7/17/2013 9:45 AM, Corinna Vinschen wrote:
> On Jul 17 09:36, Charles Wilson wrote:
>> Could we add a new cygwin_internal routine that triggers the
>> allocation, creation and return of a suitable single-line command?
>> Then run & friends could do (pseudo-code):

> That should be unnecessary.  The culprit here is the default main
> routine in cygwin's libcmain.c, which calls WinMain if the executable
> doesn't provide its own main.
>
> It doesn't construct the single-line commandline from argv, but rather
> it calls GetCommandLinė.  This, obviously, creates an empty command line
> for WinMain.
>
> So, the actual fix is to change libcmain's main() routine to create
> WinMain's cmdline arg from argc/argv.

Ack.

> However, either way, you will have to rebuild run/run2 for both
> architectures since libcmain.c is linked statically to the executable.

Right.

> So, if we do it this way, we should probably upload a new Cygwin DLL
> with the patched libcmain ASAP, so you can rebuild against the new
> libcmain.  Or, actually it would be better you would test this as soon
> as we made the patch, *before* releasing a new Cygwin DLL.

NP. Both of those packages have been recently rebuilt, so they are "up 
to date" with regard to the (relatively recent) w32api and cygport 
improvements; it's just a simply rebuild with no other changes.

> Anyway, if we do it that way, let's hope no other tool is doing the
> same...

Seems pretty unlikely to me. Most cygwin apps derive from a unix or 
traditional programming model heritage, and use main(). Very few would 
seem to derive from a Win32 heritage with WinMain() (why bother? just 
run the native program instead of porting a windows app to cygwin).

--
Chuck


--
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

