[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



On Thu, Apr 7, 2011 at 3:48 PM, Gisle Vanem <gvanem@xxxxxxxxxxxx> wrote:
> 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());

What guarantees that TEMP will always be defined?
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev