aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Best <gbe@ring0.de>2013-07-07 20:41:24 +0200
committerChristoph Lohmann <20h@r-36.net>2013-07-12 06:48:18 +0200
commit97ce0f717a69717ab28bc59072fef42d94b1fda8 (patch)
tree46011f3201fdaee0d2802949bd5ced4de401dada
parent18eef19217a306c5b83193da8662b2b970ce4e47 (diff)
Don't set cmd[0] to the window ID
Ahoy, the attached patch fixes a tiny issue with tabbed. When running it without a command and having it run spawn(), it tried to execute its window ID as a command. While most people probably don't have executables called 341123 or the like in their path, I think that is not exactly intended. The following patch fixes that: From c7ade36f8ef6429546ad89bc9ab479fa44c4790a Mon Sep 17 00:00:00 2001 From: Gregor Best <gbe@ring0.de> Date: Sun, 7 Jul 2013 20:36:06 +0200 Subject: [PATCH] Don't set cmd[0] to the window ID Starting tabbed without a command sets cmd[0] to the window ID of tabbed. This leads to funky errors such as "execvp: <ID> failed: no such file or directory" when running spawn(). Signed-off-by: Gregor Best <gbe@ring0.de> Signed-off-by: Christoph Lohmann <20h@r-36.net>
-rw-r--r--tabbed.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tabbed.c b/tabbed.c
index a76c2a8..ba1df21 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -856,6 +856,8 @@ setcmd(int argc, char *argv[], int replace) {
int i;
cmd = emallocz((argc+2) * sizeof(*cmd));
+ if (argc == 0)
+ return;
for(i = 0; i < argc; i++)
cmd[i] = argv[i];
cmd[(replace > 0)? replace : argc] = winid;