case-sensitiveness of environment problem
Tue Apr 17 09:22:00 GMT 2001
On Tue, Apr 17, 2001 at 06:39:09PM +0400, egor duda wrote:
>Tuesday, 17 April, 2001 Christopher Faylor firstname.lastname@example.org wrote:
>>> if cygwin environment contains both 'Path' and 'PATH', creating
>>>windows environment from it causes crash due to reallocating memory
>>>object which is externally referenced. this patch fixes that.
>>>i feel that we need a bit more tweaking with environment to deal with
>>>it case-insensitiveness under win32.
>CF> I don't think that this is due to case insensitivity as much as someone
>CF> supplying a non-malloced PATH string.
>it is. suppose we have cygwin environment containing
You're right. I really should have looked at the code more closely.
I think we can solve this trivially by making getwinenv perform a
case-sensitive comparison, though, can't we? I think it probably should
be case-sensitive anyway.
>CF> Your patch doesn't look right, since it is storing the environ string in
>CF> an alloca'ed buffer. Since alloca is stack based, won't the buffer be
>CF> overwritten once the function returns?
>this buffer is temporary and used internally in winenv. all data is
>copied to 'envblock' later.
Sigh. You're right again. I use alloca a few lines below this. Sorry
for the noise.
More information about the Cygwin-patches