This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Make getenv() functional before the environment is initialized


On Mon, Apr 24, 2006 at 12:16:34PM -0400, Pierre A. Humblet wrote:
>----- Original Message ----- 
>From: "Christopher Faylor"
>To: <cygwin-patches@cygwin.com>
>Sent: Friday, April 21, 2006 5:39 PM
>Subject: Re: [Patch] Make getenv() functional before the environment is 
>initialized
>
>
>>I just talked to Corinna about this on IRC and neither of us really
>>cares enough about this to merit a long discussion so I've just checked
>>in a variation of the cmalloc patch.  The only change that I made was to
>>define a HEAP_2_STR value so that the HEAP_1_MAX usage is confined to
>>cygheap.cc where I'd intended it.
>
>Thanks a lot, Chris & Corinna.
>
>Now that I am trying it, it doesn't work anymore when launched from Cygwin.
>
>I am starting to wonder if the current
>*ptr[len] == '='
>is equivalent to the former
>*(*ptr + s) == '='
>when s = len and ptr is a char **

If it didn't work, I'd think that g++ would complain.  However, this
isn't really something that needs much discussion since it is easy to
test.

Create the below program and name it 'foo'.  Then, make sure that the
current directory is in your path, and type 'foo'.

I get a "it works" when I do this.

cgf

#include <stdio.h>

int
main (int argc, char **argv)
{
  if (*argv[0] == 'f')
    puts ("it works");
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]