diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-04-04 18:48:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-04-04 18:48:38 +0000 |
commit | c11891f34e66b20b4a5932d6dc2759ea07aa9fc1 (patch) | |
tree | f4f406ae3b96afdb1330dc235a083fd7d22660fb /usr.bin/tmux | |
parent | 01c65ba9e245a2f7e035d19f425293b772209488 (diff) |
Squash a function that is only called in a callback into the callback
function.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/tmux.h | 3 | ||||
-rw-r--r-- | usr.bin/tmux/window.c | 33 |
2 files changed, 14 insertions, 22 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 49b763b107a..4b682c0de25 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.213 2010/03/22 19:18:46 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.214 2010/04/04 18:48:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1828,7 +1828,6 @@ void window_pane_alternate_off( int window_pane_set_mode( struct window_pane *, const struct window_mode *); void window_pane_reset_mode(struct window_pane *); -void window_pane_parse(struct window_pane *); void window_pane_key(struct window_pane *, struct client *, int); void window_pane_mouse(struct window_pane *, struct client *, struct mouse_event *); diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index cb4f89ccb1e..1987d6e75eb 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.45 2010/03/22 19:07:52 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.46 2010/04/04 18:48:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -586,9 +586,19 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, void window_pane_read_callback(unused struct bufferevent *bufev, void *data) { - struct window_pane *wp = data; + struct window_pane *wp = data; + char *new_data; + size_t new_size; + + new_size = EVBUFFER_LENGTH(wp->event->input) - wp->pipe_off; + if (wp->pipe_fd != -1 && new_size > 0) { + new_data = EVBUFFER_DATA(wp->event->input); + bufferevent_write(wp->pipe_event, new_data, new_size); + } - window_pane_parse(wp); + input_parse(wp); + + wp->pipe_off = EVBUFFER_LENGTH(wp->event->input); } /* ARGSUSED */ @@ -727,23 +737,6 @@ window_pane_reset_mode(struct window_pane *wp) } void -window_pane_parse(struct window_pane *wp) -{ - char *data; - size_t new_size; - - new_size = EVBUFFER_LENGTH(wp->event->input) - wp->pipe_off; - if (wp->pipe_fd != -1 && new_size > 0) { - data = EVBUFFER_DATA(wp->event->input); - bufferevent_write(wp->pipe_event, data, new_size); - } - - input_parse(wp); - - wp->pipe_off = EVBUFFER_LENGTH(wp->event->input); -} - -void window_pane_key(struct window_pane *wp, struct client *c, int key) { struct window_pane *wp2; |