summaryrefslogtreecommitdiff
path: root/www/cgic/patches/patch-ac
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2004-07-20 21:44:29 +0000
committerjmmv <jmmv@pkgsrc.org>2004-07-20 21:44:29 +0000
commit46f793f28f476bbbd533962a1537d6b4ee649b63 (patch)
treee6ad0ab0b7727d41aeb46531ab74672f42c86dba /www/cgic/patches/patch-ac
parentce66e4c1bbe9476f86df255c8b09ca365ff8d7ef (diff)
downloadpkgsrc-46f793f28f476bbbd533962a1537d6b4ee649b63.tar.gz
Initial import of cgic, version 2.02, provided by cinnion at ka8zrt.com:
This is the code written to accompany Thomas Boutell's book "CGI Programming in C & Perl". It provides a library of routines for use in CGI programming, and unlike cgilib-0.5, this library handles the "multipart/form-data" encoding required to use the FILE input control type as defined in the HTML specification. NOTE: It should be aware that there were a few developer visible changes made from Thomas Boutell's original distribution when integrating it with the NetBSD packages environment. They are: 1) Instead of being yet another source file which is used in building the application, the package have been converted totally into a library format. This library is linked using "-lcgic". 2) As a result of the first item, the developer no longer writes their entry point under the function name of cgiMain(). Instead, the user will provide their own main(), and will need to call cgiInit() before any other cgic function is called.
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 */