diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-18 22:53:24 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-18 22:53:24 +0200 |
commit | db51730df1817fc4b6ecf5a065c69fac518ad821 (patch) | |
tree | d7966f2f74b8f11cb6bb228a422bf4650e9bc7d9 /src/undo.c | |
parent | 517f71ab17c265602465eaee3775dcfe8afe0478 (diff) | |
download | vim-git-db51730df1817fc4b6ecf5a065c69fac518ad821.tar.gz |
patch 8.1.1567: localtime_r() does not respond to $TZ changesv8.1.1567
Problem: Localtime_r() does not respond to $TZ changes.
Solution: If $TZ changes then call tzset(). (Tom Ryder)
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/undo.c b/src/undo.c index dd4667001..4a4a33cc1 100644 --- a/src/undo.c +++ b/src/undo.c @@ -3111,18 +3111,12 @@ ex_undolist(exarg_T *eap UNUSED) u_add_time(char_u *buf, size_t buflen, time_t tt) { #ifdef HAVE_STRFTIME -# ifdef HAVE_LOCALTIME_R struct tm tmval; -# endif struct tm *curtime; if (vim_time() - tt >= 100) { -# ifdef HAVE_LOCALTIME_R - curtime = localtime_r(&tt, &tmval); -# else - curtime = localtime(&tt); -# endif + curtime = vim_localtime(&tt, &tmval); if (vim_time() - tt < (60L * 60L * 12L)) /* within 12 hours */ (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); |