[tor-dev] [Patch] src/test.c

Nick Mathewson nickm at freehaven.net
Thu Apr 7 21:32:47 UTC 2011


On Thu, Apr 7, 2011 at 5:17 PM, Steven J. Murdoch
<tor+Steven.Murdoch at cl.cam.ac.uk> wrote:
> On Thu, Apr 07, 2011 at 05:10:05PM -0400, Nick Mathewson wrote:
>> On Thu, Apr 7, 2011 at 3:48 PM, Gisle Vanem <gvanem at broadpark.no> wrote:
>> > -               "c:\\windows\\temp\\tor_test_%d", (int)getpid());
>> > +               "%s\\tor_test_%d", getenv("TEMP"), (int)getpid());
>>
>> What guarantees that TEMP will always be defined?
>
> A Windows (or DOS) system with %TEMP% undefined can reasonably be
> expected to not work properly. On the other hand, a Windows system
> which doesn't have a C: drive should work correctly. We could be a bit
> defensive and if %TEMP% isn't defined, fall back on C:\WINDOWS\TEMP?

Sounds fine to me.  Alternatively, I believe we could just call
GetTempPath(): that's what it's there for.

-- 
Nick


More information about the tor-dev mailing list