=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-if-shell.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/tmux/cmd-if-shell.c 2013/03/24 09:54:10 1.20 --- src/usr.bin/tmux/cmd-if-shell.c 2013/03/25 11:36:42 1.21 *************** *** 1,4 **** ! /* $OpenBSD: cmd-if-shell.c,v 1.20 2013/03/24 09:54:10 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha --- 1,4 ---- ! /* $OpenBSD: cmd-if-shell.c,v 1.21 2013/03/25 11:36:42 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha *************** *** 59,77 **** struct args *args = self->args; struct cmd_if_shell_data *cdata; char *shellcmd; ! struct session *s; ! struct winlink *wl; ! struct window_pane *wp; struct format_tree *ft; ! wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp); ! if (wl == NULL) ! return (CMD_RETURN_ERROR); ft = format_create(); ! format_session(ft, s); ! format_winlink(ft, s, wl); ! format_window_pane(ft, wp); shellcmd = format_expand(ft, args->argv[0]); format_free(ft); --- 59,79 ---- struct args *args = self->args; struct cmd_if_shell_data *cdata; char *shellcmd; ! struct session *s = NULL; ! struct winlink *wl = NULL; ! struct window_pane *wp = NULL; struct format_tree *ft; ! if (args_has(args, 't')) ! wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp); ft = format_create(); ! if (s != NULL) ! format_session(ft, s); ! if (s != NULL && wl != NULL) ! format_winlink(ft, s, wl); ! if (wp != NULL) ! format_window_pane(ft, wp); shellcmd = format_expand(ft, args->argv[0]); format_free(ft);