+static char *absolutify(char *file)
+{
+ char cwd[1024];
+
+ if(*file != '/') {
+ getcwd(cwd, sizeof(cwd));
+ return(sprintf2("%s/%s", cwd, file));
+ }
+ return(sstrdup(file));
+}
+
static void forkchild(int inpath, char *prog, char *file, char *method, char *url, char *rest, int *infd, int *outfd)
{
int i;
static void forkchild(int inpath, char *prog, char *file, char *method, char *url, char *rest, int *infd, int *outfd)
{
int i;
* This is (understandably) missing from the CGI
* specification, but PHP seems to require it.
*/
* This is (understandably) missing from the CGI
* specification, but PHP seems to require it.
*/
if(inpath)
execlp(prog, prog, file, NULL);
else
if(inpath)
execlp(prog, prog, file, NULL);
else
- fprintf(out, "HTTP/1.1 %i %s\r\n", atoi(status), defstatus(atoi(status)));
+ fprintf(out, "HTTP/1.1 %i %s\n", atoi(status), defstatus(atoi(status)));
- fprintf(out, "%s: %s\r\n", headers[0], headers[1]);
+ fprintf(out, "%s: %s\n", headers[0], headers[1]);
}
sendstatus(headers, stdout);
sendheaders(headers, stdout);
}
sendstatus(headers, stdout);
sendheaders(headers, stdout);