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

Gisle Vanem gvanem at broadpark.no
Thu Apr 7 19:48:42 UTC 2011


I don't think it's a good idea to use hard-coded paths. Even in a
test source-file. Easy patch:

--- Git-latest\src\test\test.c       Wed Mar 30 11:58:28 2011
+++ src\test\test.c  Thu Mar 31 14:06:14 2011
@@ -86,7 +86,7 @@
 #ifdef MS_WINDOWS
   // XXXX
   tor_snprintf(temp_dir, sizeof(temp_dir),
-               "c:\\windows\\temp\\tor_test_%d", (int)getpid());
+               "%s\\tor_test_%d", getenv("TEMP"), (int)getpid());
   r = mkdir(temp_dir);
 #else
   tor_snprintf(temp_dir, sizeof(temp_dir), "/tmp/tor_test_%d", (int) getpid());

----------

--gv


More information about the tor-dev mailing list