summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2005-01-15 19:48:36 +0000
committersabetts <sabetts>2005-01-15 19:48:36 +0000
commit7232aa04aea8aa13c2973b637d3d0bb875065ff3 (patch)
treed3600938c41c2c7b664ebd31480f773e4a39bf01
parent13ec63671c89b35868c9db2cefdf0068b687a79d (diff)
downloadratpoison-7232aa04aea8aa13c2973b637d3d0bb875065ff3.zip
* src/actions.c (spawn): Prepend cmd with exec.
-rw-r--r--ChangeLog6
-rw-r--r--src/actions.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6460d5e..1acf88e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,13 @@
+2005-01-15 Shawn Betts <sabetts@vcn.bc.ca>
+
+ * src/actions.c (spawn): Prepend cmd with exec.
+
2004-01-15 Bernhard R. Link <brlink@debian.org>
* actions.c (cmd_focusleft,cmd_focusright,cmd_focusup,cmd_focusdown): show
currectframe if movement not possible.
-2005-01-15 Shawn Betts <katia_dilkina@verizon.net>
+2005-01-15 Shawn Betts <sabetts@vcn.bc.ca>
* src/frame.c (frame_read): correctly determine if the input
starts with "(frame ".
diff --git a/src/actions.c b/src/actions.c
index f80d227..d527782 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -2372,6 +2372,7 @@ cmd_exec (int interactive, struct cmdarg **args)
int
spawn(char *cmd)
{
+ char *tmp;
rp_child_info *child;
int pid;
@@ -2389,7 +2390,9 @@ spawn(char *cmd)
#elif defined (HAVE_SETPGRP)
setpgrp (0, 0);
#endif
- execl("/bin/sh", "sh", "-c", cmd, 0);
+ /* Prepend with exec to avoid excess /bin/sh's. */
+ tmp = xsprintf ("exec %s", cmd);
+ execl("/bin/sh", "sh", "-c", tmp, 0);
_exit(EXIT_FAILURE);
}