=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-new-window.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -r1.66 -r1.67 --- src/usr.bin/tmux/cmd-new-window.c 2017/02/03 11:57:27 1.66 +++ src/usr.bin/tmux/cmd-new-window.c 2017/03/08 13:36:12 1.67 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-window.c,v 1.66 2017/02/03 11:57:27 nicm Exp $ */ +/* $OpenBSD: cmd-new-window.c,v 1.67 2017/03/08 13:36:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -59,7 +59,6 @@ const char *cmd, *path, *template, *cwd, *to_free; char **argv, *cause, *cp; int argc, detached; - struct format_tree *ft; struct environ_entry *envent; struct cmd_find_state fs; @@ -95,10 +94,8 @@ to_free = NULL; if (args_has(args, 'c')) { - ft = format_create(item, FORMAT_NONE, 0); - format_defaults(ft, c, s, NULL, NULL); - cwd = to_free = format_expand(ft, args_get(args, 'c')); - format_free(ft); + cwd = args_get(args, 'c'); + to_free = cwd = format_single(item, cwd, c, s, NULL, NULL); } else if (item->client != NULL && item->client->session == NULL) cwd = item->client->cwd; else @@ -142,15 +139,9 @@ if (args_has(args, 'P')) { if ((template = args_get(args, 'F')) == NULL) template = NEW_WINDOW_TEMPLATE; - - ft = format_create(item, FORMAT_NONE, 0); - format_defaults(ft, c, s, wl, NULL); - - cp = format_expand(ft, template); + cp = format_single(item, template, c, s, wl, NULL); cmdq_print(item, "%s", cp); free(cp); - - format_free(ft); } if (to_free != NULL)