diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-02-01 23:43:24 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-02-01 23:43:24 +0000 |
commit | bdef2fadb9109ca7d68769232896a3314c2e0d84 (patch) | |
tree | a30d354b5130de70ec98d4b862993673a1777129 /usr.bin/tmux | |
parent | 87b2beea44b6acdd5b0cdd4e3d9de5379f38b8aa (diff) |
Remove two unused arguments from status_replace.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/cmd-pipe-pane.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/status.c | 48 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 6 |
4 files changed, 31 insertions, 32 deletions
diff --git a/usr.bin/tmux/cmd-pipe-pane.c b/usr.bin/tmux/cmd-pipe-pane.c index 8e22f25f5a1..5c31492291c 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.27 2014/10/20 22:29:25 nicm Exp $ */ +/* $OpenBSD: cmd-pipe-pane.c,v 1.28 2015/02/01 23:43:23 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -109,8 +109,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_q *cmdq) closefrom(STDERR_FILENO + 1); - command = status_replace( - c, NULL, NULL, NULL, args->argv[0], time(NULL), 0); + command = status_replace(c, NULL, args->argv[0], time(NULL), 0); execl(_PATH_BSHELL, "sh", "-c", command, (char *) NULL); _exit(1); default: diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 4e857c52646..eea79773992 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.126 2014/10/22 23:18:53 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.127 2015/02/01 23:43:23 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -779,7 +779,7 @@ server_client_set_title(struct client *c) template = options_get_string(&s->options, "set-titles-string"); - title = status_replace(c, NULL, NULL, NULL, template, time(NULL), 1); + title = status_replace(c, NULL, template, time(NULL), 1); if (c->title == NULL || strcmp(title, c->title) != 0) { free(c->title); c->title = xstrdup(title); diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index 783f46822e4..4a950bb7f6a 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.119 2015/01/20 10:57:10 sthen Exp $ */ +/* $OpenBSD: status.c,v 1.120 2015/02/01 23:43:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -75,17 +75,18 @@ status_at_line(struct client *c) /* Retrieve options for left string. */ char * -status_redraw_get_left(struct client *c, - time_t t, int utf8flag, struct grid_cell *gc, size_t *size) +status_redraw_get_left(struct client *c, time_t t, int utf8flag, + struct grid_cell *gc, size_t *size) { struct session *s = c->session; + const char *template; char *left; size_t leftlen; style_apply_update(gc, &s->options, "status-left-style"); - left = status_replace(c, NULL, - NULL, NULL, options_get_string(&s->options, "status-left"), t, 1); + template = options_get_string(&s->options, "status-left"); + left = status_replace(c, NULL, template , t, 1); *size = options_get_number(&s->options, "status-left-length"); leftlen = screen_write_cstrlen(utf8flag, "%s", left); @@ -96,17 +97,18 @@ status_redraw_get_left(struct client *c, /* Retrieve options for right string. */ char * -status_redraw_get_right(struct client *c, - time_t t, int utf8flag, struct grid_cell *gc, size_t *size) +status_redraw_get_right(struct client *c, time_t t, int utf8flag, + struct grid_cell *gc, size_t *size) { struct session *s = c->session; + const char *template; char *right; size_t rightlen; style_apply_update(gc, &s->options, "status-right-style"); - right = status_replace(c, NULL, - NULL, NULL, options_get_string(&s->options, "status-right"), t, 1); + template = options_get_string(&s->options, "status-right"); + right = status_replace(c, NULL, template, t, 1); *size = options_get_number(&s->options, "status-right-length"); rightlen = screen_write_cstrlen(utf8flag, "%s", right); @@ -432,9 +434,11 @@ skip_to: /* Replace special sequences in fmt. */ char * -status_replace(struct client *c, struct session *s, struct winlink *wl, - struct window_pane *wp, const char *fmt, time_t t, int jobsflag) +status_replace(struct client *c, struct winlink *wl, const char *fmt, time_t t, + int jobsflag) { + struct session *s = NULL; + struct window_pane *wp = NULL; static char out[BUFSIZ]; char in[BUFSIZ], ch, *iptr, *optr, *expanded; size_t len; @@ -443,11 +447,11 @@ status_replace(struct client *c, struct session *s, struct winlink *wl, if (fmt == NULL) return (xstrdup("")); - if (s == NULL && c != NULL) + if (c != NULL) s = c->session; if (wl == NULL && s != NULL) wl = s->curw; - if (wp == NULL && wl != NULL) + if (wl != NULL) wp = wl->window->active; len = strftime(in, sizeof in, fmt, localtime(&t)); @@ -620,8 +624,8 @@ status_job_callback(struct job *job) /* Return winlink status line entry and adjust gc as necessary. */ char * -status_print( - struct client *c, struct winlink *wl, time_t t, struct grid_cell *gc) +status_print(struct client *c, struct winlink *wl, time_t t, + struct grid_cell *gc) { struct options *oo = &wl->window->options; struct session *s = c->session; @@ -642,7 +646,7 @@ status_print( else if (wl->flags & (WINLINK_ACTIVITY|WINLINK_SILENCE)) style_apply_update(gc, oo, "window-status-activity-style"); - text = status_replace(c, NULL, wl, NULL, fmt, t, 1); + text = status_replace(c, wl, fmt, t, 1); return (text); } @@ -768,11 +772,9 @@ status_prompt_set(struct client *c, const char *msg, const char *input, status_message_clear(c); status_prompt_clear(c); - c->prompt_string = status_replace(c, NULL, NULL, NULL, msg, - time(NULL), 0); + c->prompt_string = status_replace(c, NULL, msg, time(NULL), 0); - c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input, - 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; @@ -820,12 +822,10 @@ void status_prompt_update(struct client *c, const char *msg, const char *input) { free(c->prompt_string); - c->prompt_string = status_replace(c, NULL, NULL, NULL, msg, - time(NULL), 0); + c->prompt_string = status_replace(c, NULL, msg, time(NULL), 0); free(c->prompt_buffer); - c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input, - time(NULL), 0); + c->prompt_buffer = status_replace(c, NULL, input, time(NULL), 0); c->prompt_index = strlen(c->prompt_buffer); c->prompt_hindex = 0; diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index b7d9193bdad..320a466e251 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.485 2015/01/20 08:18:04 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.486 2015/02/01 23:43:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1926,8 +1926,8 @@ void status_free_jobs(struct status_out_tree *); void status_update_jobs(struct client *); void status_set_window_at(struct client *, u_int); int status_redraw(struct client *); -char *status_replace(struct client *, struct session *, struct winlink *, - struct window_pane *, const char *, time_t, int); +char *status_replace(struct client *, struct winlink *, const char *, time_t, + int); void printflike(2, 3) status_message_set(struct client *, const char *, ...); void status_message_clear(struct client *); int status_message_redraw(struct client *); |