From 04dbbb6470f6a04714a3d4b80939b32c2849892e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Wed, 11 Nov 2009 16:21:20 +0100 Subject: [PATCH] Fix chdir() patch --- fcgi-cgi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcgi-cgi.c b/fcgi-cgi.c index 8272b92..234170b 100644 --- a/fcgi-cgi.c +++ b/fcgi-cgi.c @@ -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 :) */ { char *dir = strdup(path), *sep; - if (NULL == (sep = strrchr(path, '/'))) { + if (NULL == (sep = strrchr(dir, '/'))) { chdir("/"); } else { *sep = '\0';