From: Fredrik Tolf Date: Tue, 31 Aug 2010 22:20:28 +0000 (+0200) Subject: callcgi: Fixed PATH_INFO bug. X-Git-Tag: 0.1~45 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=33f29d6778ddc733a054e07d0d255f63a77797ac callcgi: Fixed PATH_INFO bug. --- diff --git a/src/callcgi.c b/src/callcgi.c index 10bb87c..fb2596b 100644 --- a/src/callcgi.c +++ b/src/callcgi.c @@ -90,7 +90,10 @@ static void forkchild(int inpath, char *prog, char *file, char *method, char *ur if(getenv("HTTP_VERSION")) putenv(sprintf2("SERVER_PROTOCOL=%s", getenv("HTTP_VERSION"))); putenv(sprintf2("REQUEST_METHOD=%s", method)); - putenv(sprintf2("PATH_INFO=/%s", rest)); + if(*rest) + putenv(sprintf2("PATH_INFO=/%s", rest)); + else + putenv("PATH_INFO="); name = url; /* XXX: This is an ugly hack (I think), but though I can think * of several alternatives, none seem to be better. */