freebsd-ports/www/woadaptor/files/patch-CGI-WebObjects.c
Edwin Groothuis e6b6e3491e [NEW PORTS] www/webobjects(+) Apple WebObjects ports bundle
This is a bundle of several ports covering many typical requirements
for building an Apple WebObjects deployment environment. Each port
is or has a dependancy with some other port in the bundle, and have
therefore been lodged collectively.

	www/woadaptor

	WOAdaptor is a collection of WebObjects WebServer Adaptors.
	These include an Apache Module, CGI and FastCGI adaptors

	This is a subproject of Project Wonder and is an effort to
	pool enhancements and bug fixes for Apple's open source
	codebase.

	WWW: http://wonder.sourceforge.net/WOAdaptor.html

PR:		ports/117299
Submitted by:	Quinton Dolan <q@onthenet.com.au>
2008-06-13 06:29:46 +00:00

42 lines
1.3 KiB
C

--- CGI/WebObjects.c.orig Sun May 13 01:12:59 2007
+++ CGI/WebObjects.c Sun May 13 01:23:31 2007
@@ -254,19 +254,7 @@
* extract WebObjects application name from URI
*/
- qs = getenv("QUERY_STRING");
- if (qs) {
- qs_len = strlen(qs);
- } else {
- qs_len = 0;
- }
-
- if (qs_len > 0) {
- /* Make room for query string and "?" */
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1 + qs_len + 2);
- } else {
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
- }
+ url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
strcpy(url, script_name);
strcat(url, path_info);
WOLog(WO_INFO,"<CGI> new request: %s",url);
@@ -371,11 +359,14 @@
}
/* Always get the query string */
- /* Don't add ? if the query string is empty. */
+ qs = getenv("QUERY_STRING");
+ if (qs) {
+ qs_len = strlen(qs);
+ } else {
+ qs_len = 0;
+ }
+
if (qs_len > 0) {
- /* Add the query string to the full URL - useful for debugging */
- strcat(url, "?");
- strcat(url, qs);
wc.queryString.start = qs;
wc.queryString.length = qs_len;
WOLog(WO_INFO,"<CGI> new request with Query String: %s", qs);