=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.166 retrieving revision 1.167 diff -u -r1.166 -r1.167 --- src/usr.bin/tmux/window-copy.c 2017/02/08 17:33:51 1.166 +++ src/usr.bin/tmux/window-copy.c 2017/03/08 13:36:12 1.167 @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.166 2017/02/08 17:33:51 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.167 2017/03/08 13:36:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1604,29 +1604,23 @@ } static void -window_copy_copy_pipe(struct window_pane *wp, struct session *sess, +window_copy_copy_pipe(struct window_pane *wp, struct session *s, const char *bufname, const char *arg) { - void *buf; - size_t len; - struct job *job; - struct format_tree *ft; - char *expanded; + void *buf; + size_t len; + struct job *job; + char *expanded; buf = window_copy_get_selection(wp, &len); if (buf == NULL) return; + expanded = format_single(NULL, arg, NULL, s, NULL, wp); - ft = format_create(NULL, FORMAT_NONE, 0); - format_defaults(ft, NULL, sess, NULL, wp); - expanded = format_expand(ft, arg); - - job = job_run(expanded, sess, NULL, NULL, NULL, NULL); + job = job_run(expanded, s, NULL, NULL, NULL, NULL); bufferevent_write(job->event, buf, len); free(expanded); - format_free(ft); - window_copy_copy_buffer(wp, bufname, buf, len); }