Event buttonpress: Fix bug #9 opened by Cheaterman.

This commit is contained in:
Martin Duquesnoy
2009-03-28 19:17:46 +01:00
parent 0faf031150
commit a3f144f642
4 changed files with 22 additions and 8 deletions

View File

@@ -217,10 +217,12 @@ spawn(const char *format, ...)
vsprintf(cmd, format, ap);
va_end(ap);
if(!(sh = getenv("SHELL")))
sh = "/bin/sh";
if(!strlen(cmd))
return;
if(!(sh = getenv("SHELL")))
sh = "/bin/sh";
if(fork() == 0)
{
if(fork() == 0)
@@ -229,7 +231,7 @@ spawn(const char *format, ...)
close(ConnectionNumber(dpy));
setsid();
execl(sh, sh, "-c", cmd, (char*)NULL);
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
}
exit(EXIT_SUCCESS);
}