This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [Patch] Make getenv() functional before the environment is initialized
On Mon, Apr 24, 2006 at 12:35:59PM -0400, Christopher Faylor wrote:
>I get a "it works" when I do this.
>
>#include <stdio.h>
>
>int
>main (int argc, char **argv)
>{
> if (*argv[0] == 'f')
> puts ("it works");
>}
But, in keeping with my previously noticed propensity for gaining
intelligence five seconds after hitting 'y', it occurred to me that my
test case was flawed. Changing the above 'if' so that it did this:
if (*argv[1] == 'o')
resulted in a SEGV. So I got the precedence of '*' wrong. I've checked
in a patch to deal with this problem.
cgf