Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-06-14 11:50:40 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-06-14 11:50:40 +0400
commit9bc99decb73926248915e1ae99ea694263f2c41d (patch)
tree3d8c6a3b74bcca1606e69426fc8640713c92e0d3 /newlib
parent4226571d7af401f07fea4797b93c2c888f5e9880 (diff)
* libc/time/tzset_r.c (tzset_r): Correct behavior for changing from
non-GMT to GMT, when un-setting TZ. Set _timezone and _daylight even if no DST is given in TZ.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog6
-rw-r--r--newlib/libc/time/tzset_r.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index c01858381..350c93345 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-14 Craig Howland <howland@LGSInnovations.com>
+
+ * libc/time/tzset_r.c (tzset_r): Correct behavior for changing from
+ non-GMT to GMT, when un-setting TZ. Set _timezone and _daylight even
+ if no DST is given in TZ.
+
2011-06-13 Eric Blake <eblake@redhat.com>
* libc/stdio/wsetup.c (__swsetup_r): Set errno on failure.
diff --git a/newlib/libc/time/tzset_r.c b/newlib/libc/time/tzset_r.c
index d8f5c667e..5a5a9599b 100644
--- a/newlib/libc/time/tzset_r.c
+++ b/newlib/libc/time/tzset_r.c
@@ -28,6 +28,8 @@ _DEFUN (_tzset_r, (reent_ptr),
_daylight = 0;
_tzname[0] = "GMT";
_tzname[1] = "GMT";
+ free(prev_tzenv);
+ prev_tzenv = NULL;
TZ_UNLOCK;
return;
}
@@ -80,8 +82,10 @@ _DEFUN (_tzset_r, (reent_ptr),
tzenv += n;
if (sscanf (tzenv, "%10[^0-9,+-]%n", __tzname_dst, &n) <= 0)
- {
+ { /* No dst */
_tzname[1] = _tzname[0];
+ _timezone = tz->__tzrule[0].offset;
+ _daylight = 0;
TZ_UNLOCK;
return;
}