summaryrefslogtreecommitdiff
path: root/lib/nstrftime.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-11-13 10:56:26 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2018-11-13 10:59:31 -0800
commit7e2a1543985a770c93c9825c661bbb9b51b5e36f (patch)
treeeeeef6824307166014c2536d1e5b71e658e2180b /lib/nstrftime.c
parent5c0d8bb95bbd5354e6b2cd2e56a91afe4e780759 (diff)
downloademacs-7e2a1543985a770c93c9825c661bbb9b51b5e36f.tar.gz
emacs-7e2a1543985a770c93c9825c661bbb9b51b5e36f.tar.bz2
emacs-7e2a1543985a770c93c9825c661bbb9b51b5e36f.zip
Update from Gnulib
This incorporates: 2018-11-03 nstrftime: simplify test for mktime failure 2018-11-02 gnulib-common.m4: port _Noreturn to C++ 2018-10-22 std-gnu11: Support Autoconf versions < 2.64 2018-10-22 Assume Autoconf >= 2.63 2018-10-16 Remove support for Ultrix 2018-10-16 getloadavg: Remove support for ConvexOS 2018-10-16 getloadavg: Remove support for Sony NEWS 2018-10-16 Remove support for Dynix/ptx 2018-10-16 fsusage: Remove support for AIX 3 2018-10-16 fsusage, stat-size, getloadavg: Remove support for AIX PS/2 2018-10-16 getloadavg: Remove support for HP-UX on m68k 2018-10-16 fsusage, mountlist: Remove support for DolphinOS 2018-10-16 getloadavg: Remove support for Alliant FX/2800 2018-10-16 getloadavg: Remove support for tek4300 2018-10-16 getloadavg: Remove support for Ardent * build-aux/config.guess, build-aux/config.sub, lib/_Noreturn.h: * lib/fsusage.c, lib/getgroups.c, lib/getloadavg.c: * lib/nstrftime.c, lib/time.in.h, m4/errno_h.m4: * m4/fsusage.m4, m4/getgroups.m4, m4/gnulib-common.m4, m4/longlong.m4: * m4/std-gnu11.m4, m4/stdint.m4: Copy from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate:
Diffstat (limited to 'lib/nstrftime.c')
-rw-r--r--lib/nstrftime.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index 46e806e6049..1dd49c0f782 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -1438,28 +1438,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
# endif
ltm = *tp;
+ ltm.tm_wday = -1;
lt = mktime_z (tz, &ltm);
-
- if (lt == (time_t) -1)
- {
- /* mktime returns -1 for errors, but -1 is also a
- valid time_t value. Check whether an error really
- occurred. */
- struct tm tm;
-
- if (! localtime_rz (tz, &lt, &tm)
- || ((ltm.tm_sec ^ tm.tm_sec)
- | (ltm.tm_min ^ tm.tm_min)
- | (ltm.tm_hour ^ tm.tm_hour)
- | (ltm.tm_mday ^ tm.tm_mday)
- | (ltm.tm_mon ^ tm.tm_mon)
- | (ltm.tm_year ^ tm.tm_year)))
- break;
- }
-
- if (! localtime_rz (0, &lt, &gtm))
+ if (ltm.tm_wday < 0 || ! localtime_rz (0, &lt, &gtm))
break;
-
diff = tm_diff (&ltm, &gtm);
}
#endif