delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/10/31/20:27:47

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Wed, 31 Oct 2001 20:28:39 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: setup.exe command line options
Message-ID: <20011031202839.A29302@redhat.com>
Reply-To: cygwin-developers AT cygwin DOT com
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <EA18B9FA0FE4194AA2B4CDB91F73C0EF7A46 AT itdomain002 DOT itdomain DOT net DOT au>
Mime-Version: 1.0
In-Reply-To: <EA18B9FA0FE4194AA2B4CDB91F73C0EF7A46@itdomain002.itdomain.net.au>
User-Agent: Mutt/1.3.21i

On Thu, Nov 01, 2001 at 12:29:08PM +1100, Robert Collins wrote:
>> > -----Original Message-----
>> > From: Christopher Faylor [mailto:cgf AT redhat DOT com]
>> > Sent: Thursday, November 01, 2001 11:24 AM
>> > To: cygwin-developers AT cygwin DOT com
>> > Subject: Re: setup.exe command line options
>> > 
>> > 
>> > On Thu, Nov 01, 2001 at 10:00:23AM +1100, Robert Collins wrote:
>> > >> I'd appreciate it if the current argv code was reverted 
>> > ASAP.  We can't
>> > >> use the cygwin argv stuff in setup.exe.
>> > >
>> > >Why not? It's been cleanly extracted, and is (one way) GPL 
>> > compatible.
>> > 
>> > Then there is also the technical reason that we don't need it since
>> > __argv seems to do what we need automatically.  Just 
>> include stdlib.h
>> > and you have the parsed command line available.
>
>Have you tested this? AFAICT the __argv is for -mconsole programs only,
>with the main prolog initialising them in the msvcrt dll init... which
>in setup is not happening. 
>
>Or, IOW, __argc and __argv have been meaningless on every test I've
>done.

Yes.  I tested it with -mwindows -mno-cygwin.  I couldn't print to the
console in that case so I ran it under the debugger.

I copied the WinMain from setup.exe into a test program.

cgf

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

int WINAPI
WinMain (HINSTANCE h,
	 HINSTANCE hPrevInstance,
	 LPSTR command_line,
	 int cmd_show)
{
  char **argv;
  int i;
  for (i = 0, argv = __argv; *argv; argv++)
    printf ("%d - '%s'\n", i, *argv);
}

- Raw text -


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