This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
setenv_r.c (_setenv_r): Call tzset [PATCH]
- From: Shaun Jackman <sjackman at gmail dot com>
- To: newlib at sources dot redhat dot com
- Date: Wed, 19 Jan 2005 15:04:33 -0800
- Subject: setenv_r.c (_setenv_r): Call tzset [PATCH]
- Reply-to: Shaun Jackman <sjackman at gmail dot com>
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;