delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/11/18/13:00:25

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:reply-to:mime-version:to
:subject:content-type:content-transfer-encoding; q=dns; s=
default; b=hGwOFnH87j++1FiMQbccNrI16hye+9fhYYLzp4H+sYMO9fQICX3Wa
Jys2eJB3sJ4FZ6yV1KLNBFRH5fhXPV7Kf8gfHKamwTI9wrb3tXCxx5B7pcJ7GkzS
aE3kHjcpIS785jycVghXW1NeAvrR4HBPCSnLplPGXZAQv/sxe0a+1E=
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:reply-to:mime-version:to
:subject:content-type:content-transfer-encoding; s=default; bh=i
S0eTbYF0vWcEMosXfnXD4jQXjU=; b=bPHsrYZb4OS98cD4kWNvn6Q4tB4fU5AJC
/uYpQ00s739y16UcegsuGjgKqb8gbBNUQvkkDYsI4PFBxIYVq/jlX2i9DUBrL0X5
01Fh9km98dlExunZP9pBuFdyWPIjsahHsLCRq/5CjN/83GF1ONPUtGZtU+jet8EG
m3pZ2lLuYQ=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=BAYES_50,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2
X-HELO: p3plsmtpa07-03.prod.phx3.secureserver.net
Message-ID: <528A5578.3070005@w5pny.com>
Date: Mon, 18 Nov 2013 10:59:20 -0700
From: Harry G McGavran Jr <w5pny AT w5pny DOT com>
Reply-To: w5pny AT w5pny DOT com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Problem with latest setup-x86.exe

Corinna Vinschen wrote:
>I just explained that in a reply an the cygwin-apps list:
>http://cygwin.com/ml/cygwin-apps/2013-11/msg00075.html>
>
>I applied a patch to setup which should fix the issue.
>

I grabbed the latest source (which has the nt_fopen in it)
and built it without the argv patch, but it still has the same
problem. __argv is always zero.

So, I tried the following under cygwin's mingw32:



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

/* extern char *** __p___argv(void); */


#if 1
#define argc _argc
#define argv _argv
#endif

#if 0
#define argc __argc
#define argv __argv
#endif

int main(int argc, char **argv, char **envp)
{
register int i;

printf ("_argc = 0x%x\n", _argc);
printf ("__argc = 0x%x\n", __argc);
printf ("__p___argc() = 0x%x\n", __p___argc());
printf ("*(__p___argc()) = 0x%x\n", *(__p___argc()));
printf ("\n");
printf ("_argv = 0x%x\n", _argv);
printf ("__argv = 0x%x\n", __argv);
printf ("__p___argv() = 0x%x\n", __p___argv());
printf ("*(__p___argv()) = 0x%x\n", *(__p___argv()));
printf ("\n");

printf("argc=%d\n", argc);
for (i=0; i<argc; i++)
printf("argv[%d]=%s\n", i, argv[i]);
return(0);
}

and then I ran it on my machine and four other windows 7 pro machines
using "tst abc def" and get:


_argc = 0x3
__argc = 0x0
__p___argc() = 0x755830e4
*(__p___argc()) = 0x0

_argv = 0x5b1680
__argv = 0x0
__p___argv() = 0x755830c0
*(__p___argv()) = 0x0

argc=3
argv[0]=C:\cygwin\usr\local\src\cygwin_setup\tst\tst.exe
argv[1]=abc
argv[2]=def

on all these machines.

I don't know how that for loop on __argv in main.cc can work with __argv
always returning zero, but admittedly setup.exe does work
on some of these machines without my changes, just not on others.
My changes produce a setup that does work on all of them.
I have to admit I haven't been able to figure out what __argv really
does since it always returns zero on any machine I try.  So, I'm still
puzzled.





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