=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.121 retrieving revision 1.122 diff -c -r1.121 -r1.122 *** src/usr.bin/tmux/status.c 2015/02/05 10:29:43 1.121 --- src/usr.bin/tmux/status.c 2015/02/06 17:11:39 1.122 *************** *** 1,4 **** ! /* $OpenBSD: status.c,v 1.121 2015/02/05 10:29:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: status.c,v 1.122 2015/02/06 17:11:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 760,773 **** int (*callbackfn)(void *, const char *), void (*freefn)(void *), void *data, int flags) { ! int keys; status_message_clear(c); status_prompt_clear(c); ! c->prompt_string = status_replace(c, NULL, msg, time(NULL), 0); ! c->prompt_buffer = status_replace(c, NULL, input, time(NULL), 0); c->prompt_index = strlen(c->prompt_buffer); c->prompt_callbackfn = callbackfn; --- 760,779 ---- int (*callbackfn)(void *, const char *), void (*freefn)(void *), void *data, int flags) { ! struct format_tree *ft; ! int keys; ! time_t t; + ft = format_create(); + format_defaults(ft, c, NULL, NULL, NULL); + t = time(NULL); + status_message_clear(c); status_prompt_clear(c); ! c->prompt_string = format_expand_time(ft, msg, time(NULL)); ! c->prompt_buffer = format_expand_time(ft, input, time(NULL)); c->prompt_index = strlen(c->prompt_buffer); c->prompt_callbackfn = callbackfn; *************** *** 786,791 **** --- 792,799 ---- c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE); c->flags |= CLIENT_STATUS; + + format_free(ft); } /* Remove status line prompt. */ *************** *** 814,829 **** void status_prompt_update(struct client *c, const char *msg, const char *input) { free(c->prompt_string); ! c->prompt_string = status_replace(c, NULL, msg, time(NULL), 0); free(c->prompt_buffer); ! c->prompt_buffer = status_replace(c, NULL, input, time(NULL), 0); c->prompt_index = strlen(c->prompt_buffer); c->prompt_hindex = 0; c->flags |= CLIENT_STATUS; } /* Draw client prompt on status line of present else on last line. */ --- 822,846 ---- void status_prompt_update(struct client *c, const char *msg, const char *input) { + struct format_tree *ft; + time_t t; + + ft = format_create(); + format_defaults(ft, c, NULL, NULL, NULL); + t = time(NULL); + free(c->prompt_string); ! c->prompt_string = format_expand_time(ft, msg, time(NULL)); free(c->prompt_buffer); ! c->prompt_buffer = format_expand_time(ft, input, time(NULL)); c->prompt_index = strlen(c->prompt_buffer); c->prompt_hindex = 0; c->flags |= CLIENT_STATUS; + + format_free(ft); } /* Draw client prompt on status line of present else on last line. */