Re: Patch

Kuba Winnicki <[email protected]> Fri, 27 Feb 2004 10:47:12 +0100
Newsgroups gmane.comp.web.fnord
Organization http://www.yn.pl/
Message-ID <[email protected]>
Gary Gendel wrote:

> Make sure you update CGIENVLEN from 20 to 21.

Yeah, I haven't noticed it. But, how about making it update
automagically like in the patch?

-- 
Regards,
Kuba Winnicki <[email protected]>
fnord.diff (text/plain, 476 B)
--- ../httpd/httpd.c	Fri Feb 27 10:08:16 2004
+++ httpd.c	Fri Feb 27 10:38:39 2004
@@ -261,9 +261,7 @@
 }
 
 #ifdef CGI
-#define CGIENVLEN 21
-
-static const char *cgivars[CGIENVLEN] = {
+static const char *cgivars[] = {
   "GATEWAY_INTERFACE=",
   "SERVER_PROTOCOL=",
   "SERVER_SOFTWARE=",
@@ -286,6 +284,8 @@
   "PATH_INFO=",
   "PATH_TRANSLATED="
 };
+
+#define CGIENVLEN sizeof(cgivars)/sizeof(char*)
 
 static int iscgivar(const char *s) {
   register unsigned int i=0;