delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/07/17/10:02:27

X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
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 AT cwilson DOT fastmail DOT 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 AT cygwin DOT com>
Subject: Re: Issue with run.exe and PWD with spaces since last update (Cygwin 1.7.21)
References: <295777180 DOT 20130716202913 AT mtu-net DOT ru> <20130717125916 DOT GB21347 AT calimero DOT vinschen DOT de> <51E69DE2 DOT 10008 AT cwilson DOT fastmail DOT fm> <20130717134532 DOT GC32258 AT calimero DOT vinschen DOT de>
In-Reply-To: <20130717134532.GC32258@calimero.vinschen.de>

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 GetCommandLinė.  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

- Raw text -


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