mirror of
https://github.com/vim/vim.git
synced 2025-10-17 07:44:28 -04:00
patch 8.1.1567: localtime_r() does not respond to $TZ changes
Problem: Localtime_r() does not respond to $TZ changes. Solution: If $TZ changes then call tzset(). (Tom Ryder)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user