Re: [Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-codedC:\WINDOWS for temp directory path

2011-04-08 Thread Alon Bar-Lev
On Fri, Apr 8, 2011 at 7:03 PM, Gisle Vanem wrote: > Why not a bit simpler; GetTempPath() (kernel32.dll) already does these tests. > Ref: http://msdn.microsoft.com/en-us/library/aa364992(v=vs.85).aspx : Good catch. Alon.

Re: [Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-codedC:\WINDOWS for temp directory path

2011-04-08 Thread Gisle Vanem
"David Sommerseth" wrote: - /* Try to use %TEMP% or %TMP% */ - tmpdir = getenv("TEMP"); - if( !tmpdir ) { -tmpdir = getenv("TMP"); + CLEAR (tmpdir); + + /* Try to use %TEMP%, %TMP% or %SystemRoot%\Temp */ + envptr = getenv("TEMP"); + if( envptr ) { +return