Fix chdir() patch

This commit is contained in:
Stefan Bühler 2009-11-11 16:21:20 +01:00
parent d509fbb142
commit 04dbbb6470

View File

@ -341,7 +341,7 @@ static void fcgi_cgi_child_start(fcgi_cgi_child *cld, const gchar *path) {
/* try changing the directory. don't care about memleaks, execve() coming soon :) */ /* try changing the directory. don't care about memleaks, execve() coming soon :) */
{ {
char *dir = strdup(path), *sep; char *dir = strdup(path), *sep;
if (NULL == (sep = strrchr(path, '/'))) { if (NULL == (sep = strrchr(dir, '/'))) {
chdir("/"); chdir("/");
} else { } else {
*sep = '\0'; *sep = '\0';