Opened 17 years ago

Last modified 12 years ago

#1413 closed defect

wxSetEnv-wxExpandEnvVars inconsistent in Windows

Reported by: peck797 Owned by:
Priority: normal Milestone:
Component: wxMSW Version:
Keywords: Cc: peck797, neis, vadz
Blocked By: Blocking:
Patch: no

Description

In Windows, the wxSetEnv() code uses the
SetEnvironmentVariable() Win32 API to update the
process' environment, yet the wxExpandEnvVars() uses
the _environ block to do the expansion.

The two are not compatible - it should either use
_putenv() and the existing wxExpandEnvVars() code or it
should use SetEnvironmentVariable() and
ExpandEnvironmentVariables().

I, personally, would prefer the former because it would
allow the use of the ${var} format in Windows.

The workaround of calling _putenv() explicitly within a
defined(_WIN32) macro block works for now.

Change History (1)

comment:1 Changed 12 years ago by neis

Fixed by revision 42471, which should have ensured that it's correct in 2.8.0 and later.

Note: See TracTickets for help on using tickets.