=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.75 retrieving revision 1.76 diff -c -r1.75 -r1.76 *** src/usr.bin/tmux/status.c 2011/04/29 07:07:31 1.75 --- src/usr.bin/tmux/status.c 2011/07/02 21:05:44 1.76 *************** *** 1,4 **** ! /* $OpenBSD: status.c,v 1.75 2011/04/29 07:07:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: status.c,v 1.76 2011/07/02 21:05:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 815,821 **** /* Enable status line prompt. */ void ! status_prompt_set(struct client *c, const char *msg, int (*callbackfn)(void *, const char *), void (*freefn)(void *), void *data, int flags) { --- 815,821 ---- /* Enable status line prompt. */ void ! status_prompt_set(struct client *c, const char *msg, const char *input, int (*callbackfn)(void *, const char *), void (*freefn)(void *), void *data, int flags) { *************** *** 826,833 **** c->prompt_string = xstrdup(msg); ! c->prompt_buffer = xstrdup(""); ! c->prompt_index = 0; c->prompt_callbackfn = callbackfn; c->prompt_freefn = freefn; --- 826,836 ---- c->prompt_string = xstrdup(msg); ! if (input != NULL) ! c->prompt_buffer = xstrdup(input); ! else ! c->prompt_buffer = xstrdup(""); ! c->prompt_index = strlen(c->prompt_buffer); c->prompt_callbackfn = callbackfn; c->prompt_freefn = freefn; *************** *** 871,883 **** /* Update status line prompt with a new prompt string. */ void ! status_prompt_update(struct client *c, const char *msg) { xfree(c->prompt_string); c->prompt_string = xstrdup(msg); ! *c->prompt_buffer = '\0'; ! c->prompt_index = 0; c->prompt_hindex = 0; --- 874,890 ---- /* Update status line prompt with a new prompt string. */ void ! status_prompt_update(struct client *c, const char *msg, const char *input) { xfree(c->prompt_string); c->prompt_string = xstrdup(msg); ! xfree(c->prompt_buffer); ! if (input != NULL) ! c->prompt_buffer = xstrdup(input); ! else ! c->prompt_buffer = xstrdup(""); ! c->prompt_index = strlen(c->prompt_buffer); c->prompt_hindex = 0;