Apparently, mozilla.org's Apache Web server doesn't support the

SERVER_URL envariable. Oh, well. Trying a different way...
This commit is contained in:
erik%netscape.com 2000-02-01 19:06:01 +00:00
parent de88a69286
commit 4cd75c7f85

View File

@ -187,28 +187,12 @@ getHTTPRequestHeaders(View *view, char *host, char *verbose)
char **r; char **r;
char **ret; char **ret;
char *scriptName; char *scriptName;
char *serverURL;
char *str; char *str;
serverURL = "SERVER_URL="; scriptName = "view.cgi";
scriptName = "SCRIPT_NAME=";
e = environ; e = environ;
while (*e) while (*e)
{ {
if (!strncmp(*e, serverURL, strlen(serverURL)))
{
if (strchr(*e, '='))
{
serverURL = strchr(*e, '=') + 1;
}
}
else if (!strncmp(*e, scriptName, strlen(scriptName)))
{
if (strchr(*e, '='))
{
scriptName = strchr(*e, '=') + 1;
}
}
e++; e++;
} }
ret = malloc((e - environ + 1) * sizeof(*e)); ret = malloc((e - environ + 1) * sizeof(*e));
@ -216,14 +200,12 @@ getHTTPRequestHeaders(View *view, char *host, char *verbose)
{ {
return NULL; return NULL;
} }
me = malloc(strlen(serverURL) + strlen(scriptName) + me = malloc(strlen(scriptName) + strlen(verbose) + 1);
strlen(verbose) + 1);
if (!me) if (!me)
{ {
return NULL; return NULL;
} }
strcpy(me, serverURL); strcpy(me, scriptName);
strcat(me, scriptName);
strcat(me, verbose); strcat(me, verbose);
e = environ; e = environ;