From 8969a8beafcf7ba81c55eb1a8e036066ba1bace5 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 30 Jun 2008 18:45:02 +0000 Subject: [PATCH] Don't copy default command, use NULL if specified to use previous command. --- cmd-respawn-window.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c index 0b3cb0de..429beba5 100644 --- a/cmd-respawn-window.c +++ b/cmd-respawn-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-respawn-window.c,v 1.1 2008-06-29 07:04:30 nicm Exp $ */ +/* $Id: cmd-respawn-window.c,v 1.2 2008-06-30 18:45:02 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -46,7 +46,6 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx) struct winlink *wl; struct session *s; const char *env[] = { NULL, "TERM=screen", NULL }; - char *cmd; if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL) return; @@ -56,11 +55,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx) return; } - cmd = data->arg; - if (cmd == NULL) - cmd = options_get_string(&s->options, "default-command"); - - if (window_spawn(wl->window, cmd, env) != 0) { + if (window_spawn(wl->window, data->arg, env) != 0) { ctx->error(ctx, "respawn failed: %s:%d", s->name, wl->idx); return; }