stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: STDCXX-401
Date Mon, 10 Mar 2008 21:39:27 GMT
Thanks for the patch, Scott! I think this a start, but suspect
there are a few other places in the test suite that might need
to be changed as well (the locale tests?)

Let me take this opportunity to ask you to please review our
guidelines for Submitting Patches and the expected Patch Format:

   http://stdcxx.apache.org/bugs.html#patches
   http://stdcxx.apache.org/bugs.html#patch_format

Specifically, the string [PATCH] in the subject line is helpful
in identifying patches among other discussions on the list (and
in setting up mail filters for such things). Unless the patch is
entirely trivial, we also need some narrative to go with it. For
simple patches a Change Log entry usually does the job (see bullet
3). For anything even moderately involved, a description of what
the patch actually does is recommended (bullet 1).

Finally, while we don't have a style document for stdcxx (yet) we
do follow pretty consistent formatting style. To make integrating
your patches easier for us please take a look at nearby code and
try to follow the same style especially WRT braces and whitespace
usage.

Martin

Scott Zhong wrote:
> There are a few files that this affects.
> 
> tests/src/file.cpp
> src/file.cpp
> util/memchk.cpp
> 
> tests/src/file.cpp change is listed: 
> 
> Index: file.cpp
> ===================================================================
> --- file.cpp    (revision 634377)
> +++ file.cpp    (working copy)
> @@ -205,8 +205,15 @@
>  #ifndef _RWSTD_NO_MKSTEMP
>  #  define TMP_TEMPLATE      "tmpfile-XXXXXX"
>  
> +    char* tmpdir = getenv("TMPDIR");
> +
> +    if (NULL == tmpdir)
> +    {
> +        tmpdir = P_tmpdir;
> +    }
> +
>      if (!buf) {
> -        static char fname_buf [sizeof (P_tmpdir) + sizeof
> (TMP_TEMPLATE)];
> +        static char fname_buf [sizeof (tmpdir) + sizeof
> (TMP_TEMPLATE)];
>  
>          buf = fname_buf;
>          *buf = '\0';
> @@ -214,13 +221,13 @@
>  
>      if ('\0' == *buf) {
>          // copy the template to the buffer; make sure there is exactly
> -        // one path separator character between P_tmpdir and the file
> +        // one path separator character between tmpdir and the file
>          // name template (it doesn't really matter how many there are
>          // as long as it's at least one, but one looks better than two
>          // in diagnostic messages)
> -        size_t len = sizeof (P_tmpdir) - 1;
> +        size_t len = sizeof (tmpdir) - 1;
>  
> -        memcpy (buf, P_tmpdir, len);
> +        memcpy (buf, tmpdir, len);
>          if (_RWSTD_PATH_SEP != buf [len - 1])
>              buf [len++] = _RWSTD_PATH_SEP;
>  
> @@ -248,7 +255,7 @@
>  #  if defined (_WIN32) || defined (_WIN64)
>  
>      // create a temporary file name
> -    char* fname = tempnam (P_tmpdir, ".rwtest-tmp");
> +    char* fname = tempnam (tmpdir, ".rwtest-tmp");
>  
>      if (fname) {
>  
> @@ -269,7 +276,7 @@
>      else {
>          fprintf (stderr, "%s:%d: tempnam(\"%s\", \"%s\") failed: %s\n",
>                   __FILE__, __LINE__,
> -                 P_tmpdir, ".rwtest-tmp", strerror (errno));
> +                 tmpdir, ".rwtest-tmp", strerror (errno));
>      }
>  
>  #  else
> 


Mime
View raw message