setenv_r.c (_setenv_r): Call tzset [PATCH]

Jeff Johnston jjohnstn@redhat.com
Thu Jan 20 17:32:00 GMT 2005


Patch checked in.  Thanks.

-- Jeff J.

Shaun Jackman wrote:
> The value of name is lost here:
>   for (C = (*p_environ)[offset]; (*C = *name++) && *C != '='; ++C);
> and then used here
>   if (strcmp (name, "TZ") == 0)
>     tzset ();
> 
> Cheers,
> Shaun
> 
> 2005-01-19  Shaun Jackman  <sjackman@gmail.com>
> 
> 	* libc/stdlib/setenv_r.c (_setenv_r): Call tzset() if the TZ
> 	environment variable is set.
> 
> --- setenv_r.c- 2002-04-17 14:23:30.000000000 -0700
> +++ setenv_r.c  2005-01-19 14:56:40.000000000 -0800
> @@ -122,7 +122,7 @@
>    ENV_UNLOCK;
> 
>    /* if we are setting the TZ environment variable, update timezone info */
> -  if (strcmp (name, "TZ") == 0)
> +  if (strncmp ((*p_environ)[offset], "TZ=", 3) == 0)
>      tzset ();
> 
>    return 0;



More information about the Newlib mailing list