]> www.dolda2000.com Git - ashd.git/commitdiff
callcgi: Fixed PATH_INFO bug.
authorFredrik Tolf <fredrik@dolda2000.com>
Tue, 31 Aug 2010 22:20:28 +0000 (00:20 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Tue, 31 Aug 2010 22:20:28 +0000 (00:20 +0200)
src/callcgi.c

index 10bb87c9af47e6223dc35fd237a40fad51d2d98b..fb2596bff6c6b4825afa5c08f42f5563e3a3719e 100644 (file)
@@ -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. */