summaryrefslogtreecommitdiff
path: root/www/cgic/patches/patch-ac
diff options
context:
space:
mode:
Diffstat (limited to 'www/cgic/patches/patch-ac')
-rw-r--r--www/cgic/patches/patch-ac56
1 files changed, 56 insertions, 0 deletions
diff --git a/www/cgic/patches/patch-ac b/www/cgic/patches/patch-ac
new file mode 100644
index 00000000000..eb7a2089d20
--- /dev/null
+++ b/www/cgic/patches/patch-ac
@@ -0,0 +1,56 @@
+$NetBSD: patch-ac,v 1.1.1.1 2004/07/20 21:44:29 jmmv Exp $
+
+--- cgic.c.orig Sun Jan 12 13:59:43 2003
++++ cgic.c
+@@ -124,8 +124,9 @@ static int cgiStrBeginsNc(char *s1, char
+
+ static int firstCookie = 1;
+
+-int main(int argc, char *argv[]) {
+- int result;
++int
++cgiInit(void)
++{
+ char *cgiContentLengthString;
+ char *e;
+ cgiSetupConstants();
+@@ -211,17 +212,6 @@ int main(int argc, char *argv[]) {
+ cgiOut = stdout;
+ cgiRestored = 0;
+
+-
+- /* These five lines keep compilers from
+- producing warnings that argc and argv
+- are unused. They have no actual function. */
+- if (argc) {
+- if (argv[0]) {
+- cgiRestored = 0;
+- }
+- }
+-
+-
+ if (cgiStrEqNc(cgiRequestMethod, "post")) {
+ #ifdef CGICDEBUG
+ CGICDEBUGSTART
+@@ -290,9 +280,9 @@ int main(int argc, char *argv[]) {
+ }
+ }
+ firstCookie = 1;
+- result = cgiMain();
+- cgiFreeResources();
+- return result;
++
++ atexit(cgiFreeResources);
++ return(0);
+ }
+
+ static void cgiGetenv(char **s, char *var){
+@@ -1995,7 +1985,7 @@ cgiEnvironmentResultType cgiReadEnvironm
+ FILE *in;
+ cgiFormEntry *e = 0, *p;
+ char *version;
+- cgiEnvironmentResultType result;
++ cgiEnvironmentResultType result = cgiEnvironmentSuccess;
+ /* Free any existing data first */
+ cgiFreeResources();
+ /* Be sure to open in binary mode */