diff options
-rw-r--r-- | usr.bin/tmux/cmd-display-message.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-pipe-pane.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/format.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-display-message.c b/usr.bin/tmux/cmd-display-message.c index 7eb019e7b63..203bfdf54ff 100644 --- a/usr.bin/tmux/cmd-display-message.c +++ b/usr.bin/tmux/cmd-display-message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-message.c,v 1.44 2018/04/23 13:43:08 nicm Exp $ */ +/* $OpenBSD: cmd-display-message.c,v 1.45 2019/03/14 21:27:26 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -86,7 +86,7 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item) ft = format_create(item->client, item, FORMAT_NONE, 0); format_defaults(ft, target_c, s, wl, wp); - msg = format_expand_time(ft, template, time(NULL)); + msg = format_expand_time(ft, template, 0); if (args_has(self->args, 'p')) cmdq_print(item, "%s", msg); else if (c != NULL) diff --git a/usr.bin/tmux/cmd-pipe-pane.c b/usr.bin/tmux/cmd-pipe-pane.c index 34f5fa27ec5..ce5f64da910 100644 --- a/usr.bin/tmux/cmd-pipe-pane.c +++ b/usr.bin/tmux/cmd-pipe-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-pipe-pane.c,v 1.49 2018/11/30 08:44:40 nicm Exp $ */ +/* $OpenBSD: cmd-pipe-pane.c,v 1.50 2019/03/14 21:27:26 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -110,7 +110,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) /* Expand the command. */ ft = format_create(item->client, item, FORMAT_NONE, 0); format_defaults(ft, c, s, wl, wp); - cmd = format_expand_time(ft, args->argv[0], time(NULL)); + cmd = format_expand_time(ft, args->argv[0], 0); format_free(ft); /* Fork the child. */ diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index ecea1637754..aa66a091737 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.173 2019/03/13 18:09:12 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.174 2019/03/14 21:27:26 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1482,6 +1482,8 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t) if (fmt == NULL || *fmt == '\0') return (xstrdup("")); + if (t == 0) + t = time(NULL); tm = localtime(&t); if (strftime(s, sizeof s, fmt, tm) == 0) diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index e0fe2081f81..0940234c032 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.267 2019/03/12 11:16:50 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.268 2019/03/14 21:27:26 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1537,7 +1537,7 @@ server_client_set_title(struct client *c) ft = format_create(c, NULL, FORMAT_NONE, 0); format_defaults(ft, c, NULL, NULL, NULL); - title = format_expand_time(ft, template, time(NULL)); + title = format_expand_time(ft, template, 0); if (c->title == NULL || strcmp(title, c->title) != 0) { free(c->title); c->title = xstrdup(title); |