This is the mail archive of the
mailing list for the Cygwin project.
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"
>Sent: Friday, April 21, 2006 5:39 PM
>Subject: Re: [Patch] Make getenv() functional before the environment is
>>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
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.
main (int argc, char **argv)
if (*argv == 'f')
puts ("it works");