From 33f29d6778ddc733a054e07d0d255f63a77797ac Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 1 Sep 2010 00:20:28 +0200 Subject: [PATCH] callcgi: Fixed PATH_INFO bug. --- src/callcgi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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. */ -- 2.11.0