From a5a17b40ee9cd25eae3c3d177abf4e4faa2dc4d8 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 3 Oct 2007 13:07:42 +0000 Subject: Skip exec on cmds. Also use xmemstrdup where appropriate. --- window.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index 67a37be2..ced59ffa 100644 --- a/window.c +++ b/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.16 2007-10-03 10:18:32 nicm Exp $ */ +/* $Id: window.c,v 1.17 2007-10-03 13:07:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -104,7 +104,11 @@ window_create(const char *cmd, const char **environ, u_int sx, u_int sy) screen_create(&w->screen, sx, sy); input_init(&w->ictx, &w->screen); - name = xstrdup(cmd); + /* XXX */ + if (strncmp(cmd, "exec ", (sizeof "exec ") - 1) == 0) + name = xstrdup(cmd + sizeof "exec "); + else + name = xstrdup(cmd); if ((ptr = strchr(name, ' ')) != NULL) { if (ptr != name && ptr[-1] != '\\') *ptr = '\0'; -- cgit