stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Farid Zaripov <Farid_Zari...@epam.com>
Subject Re: [PATCH] STDCXX-401 test suite should honor TMPDIR
Date Thu, 09 Oct 2008 08:20:14 GMT
Hi Scott.

> Index: file.cpp
> ===================================================================
> --- file.cpp    (revision 702657)
> +++ file.cpp    (working copy)
> @@ -208,8 +208,10 @@
>  #ifndef _RWSTD_NO_MKSTEMP
>  #  define TMP_TEMPLATE      "tmpfile-XXXXXX"
>
> +    char *tmpdir = getenv ("TMPDIR") == NULL ? P_tmpdir : getenv ("TMPDIR");

  tmpdir might be const char*. And why getenv("TMPDIR") is called twice?

> +
>      if (!buf) {
> -        static char fname_buf [sizeof (P_tmpdir) + sizeof (TMP_TEMPLATE)];
> +        static char fname_buf [sizeof (tmpdir) + sizeof (TMP_TEMPLATE)];

  Here sizeof (tmpdir) != strlen (tmpdir). I think that using here PATH_MAX is ok.

[...]
> -        size_t len = sizeof (P_tmpdir) - 1;
> +        size_t len = sizeof (tmpdir) - 1;

  Same.

Farid.

Mime
View raw message