This is the mail archive of the cygwin-developers 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: The GetCommandLine/WinMain "problem"


On Wed, Apr 05, 2006 at 12:49:09PM -0400, Pierre A. Humblet wrote:
>>However, you seem to be a little behind the times.  I am not talking
>>about doing anything new.  It's already happened.  People have already
>>reported problems with GetEnvironmentVariable due to the fact that
>>cygwin no longer fills out windows environment variables if it knows
>>that it is starting a cygwin program.
>
>I know that, it's one of the reasons why dmalloc is currently broken on
>Cygwin.  But the regular GetEnvironmentVariable does work when starting
>from Windows.  I thought you wanted to fake it to read the cygwin
>environment ( " > GetEnvironentVariable could do the same thing.  ")
>That would cause me great troubles.  Strictly speaking, I only need the
>regular GetEnvironmentVariableA.  It's OK to fake
>GetEnvironmentVariable.

I meant GetEnvironmentVariable{W,A} and any other function which deals
with environment variables.

I don't see how returning information from the cygwin environment would
affect you since any environment variables set in the windows
environment would also show up in cygwin's environment.  So, an emulated
GetEnvironmentVariable would return the proper thing no matter how the
process was started.

If it does cause problems due to something like the initialization order
of the environment vs. when malloc_init is called, then that's something
that can be ironed out.  Just a simple check of whether or not environ
is initialized should be adequate to cause any environment manipulating
function to revert to using the windows environment.

cgf


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