Fix issue #8 on github about shell absolute path in spawn function, thanks to antoineB

This commit is contained in:
Martin Duquesnoy 2012-01-18 23:27:40 +01:00
parent 1585802bf0
commit 7e05c2dadf

View File

@ -105,7 +105,7 @@ spawn(const char *format, ...)
return -1;
}
if(!(sh = getenv("SHELL")))
if(!(sh = getenv("SHELL")) || sh[0] != '/')
sh = "/bin/sh";
if((pid = fork()) == 0)