mirror of
https://github.com/tmux/tmux.git
synced 2025-04-14 15:28:50 +00:00
Use gmtime_r so the current time isn't overwritten, the minute comparison works
and the clock is actually updated. It was already used for lock-server but not here.
This commit is contained in:
parent
2660692fb1
commit
710393e388
@ -93,13 +93,13 @@ void
|
|||||||
window_clock_timer(struct window_pane *wp)
|
window_clock_timer(struct window_pane *wp)
|
||||||
{
|
{
|
||||||
struct window_clock_mode_data *data = wp->modedata;
|
struct window_clock_mode_data *data = wp->modedata;
|
||||||
struct tm *now, *then;
|
struct tm now, then;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
now = gmtime(&t);
|
gmtime_r(&t, &now);
|
||||||
then = gmtime(&data->tim);
|
gmtime_r(&data->tim, &then);
|
||||||
if (now->tm_min == then->tm_min)
|
if (now.tm_min == then.tm_min)
|
||||||
return;
|
return;
|
||||||
data->tim = t;
|
data->tim = t;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user