summaryrefslogtreecommitdiff
path: root/lib/time_rz.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-10-21 20:10:40 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-10-21 20:11:23 -0700
commit0bb27cd32e4a6a7fc4485381efc9ff0026e15689 (patch)
tree4367708145574829e615f3840bbdad923a2343a0 /lib/time_rz.c
parent2ab48bafa3e8c3c686dcadfb5d2410178e9dd269 (diff)
downloademacs-0bb27cd32e4a6a7fc4485381efc9ff0026e15689.tar.gz
Merge from gnulib
This incorporates: 2015-10-18 stdalign: work around pre-4.9 GCC x86 bug 2015-10-18 time_rz: avoid warning from bleeding-edge gcc's -Wnonnull * doc/misc/texinfo.tex, lib/stdalign.in.h, lib/time_rz.c: Copy from gnulib.
Diffstat (limited to 'lib/time_rz.c')
-rw-r--r--lib/time_rz.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/time_rz.c b/lib/time_rz.c
index f94893aa2c1..a89b7e70f14 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -90,8 +90,7 @@ extend_abbrs (char *abbrs, char const *abbr, size_t abbr_size)
}
/* Return a newly allocated time zone for NAME, or NULL on failure.
- As a special case, return a nonzero constant for wall clock time, a
- constant that survives freeing. */
+ A null NAME stands for wall clock time (which is like unset TZ). */
timezone_t
tzalloc (char const *name)
{
@@ -288,10 +287,8 @@ localtime_rz (timezone_t tz, time_t const *t, struct tm *tm)
timezone_t old_tz = set_tz (tz);
if (old_tz)
{
- tm = localtime_r (t, tm);
- if (tm && !save_abbr (tz, tm))
- tm = NULL;
- if (revert_tz (old_tz))
+ bool abbr_saved = localtime_r (t, tm) && save_abbr (tz, tm);
+ if (revert_tz (old_tz) && abbr_saved)
return tm;
}
return NULL;