http://bugs.winehq.org/show_bug.cgi?id=245
Summary: Builtin msvcrt does not set the environment properly Product: Wine Version: unspecified Platform: All OS/Version: All Status: CLOSED Severity: normal Priority: P1 Component: wine-misc AssignedTo: wine-bugs@winehq.org ReportedBy: fgouget@codeweavers.com
The bug is in dlls/msvcrt/data.c:msvcrt_init_args:
/* FIXME: This is plain wrong, we must convert from a '\0' separated * memory block to an array of pointers to string format. */ MSVCRT__environ = GetEnvironmentStringsA(); MSVCRT___initenv = MSVCRT__environ; /* FIXME: This is plain wrong, we must convert from a '\0' separated * memory block to an array of pointers to string format. */ MSVCRT__wenviron = GetEnvironmentStringsW(); MSVCRT___winitenv = MSVCRT__wenviron;
The comment says it all... almost. The above code should also call FreeEnvironmentStrings otherwise we have a memory leak.
------- Additional Comments From fgouget@codeweavers.com 2001-03-06 12:51 ------- Eric Pouech fixed this. See 'Re: warning fixes' in wine-patches.
------- Additional Comments From fgouget@codeweavers.com 2001-03-06 12:52 ------- Eric's patch is now in Wine.