-rw-r--r-- | src/plaincgi.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plaincgi.cc b/src/plaincgi.cc index 1cb7dc6..3a82d33 100644 --- a/src/plaincgi.cc +++ b/src/plaincgi.cc | |||
@@ -1,32 +1,33 @@ | |||
1 | #include <unistd.h> | 1 | #include <unistd.h> |
2 | #include <sys/types.h> | 2 | #include <sys/types.h> |
3 | #include <sys/stat.h> | 3 | #include <sys/stat.h> |
4 | #include <cstring> | ||
4 | #include "kingate/plaincgi.h" | 5 | #include "kingate/plaincgi.h" |
5 | #include "kingate/exception.h" | 6 | #include "kingate/exception.h" |
6 | #include "config.h" | 7 | #include "config.h" |
7 | 8 | ||
8 | #if !HAVE_DECL_ENVIRON | 9 | #if !HAVE_DECL_ENVIRON |
9 | extern char **environ; | 10 | extern char **environ; |
10 | #endif /* HAVE_DECL_ENVIRON */ | 11 | #endif /* HAVE_DECL_ENVIRON */ |
11 | 12 | ||
12 | namespace kingate { | 13 | namespace kingate { |
13 | 14 | ||
14 | plaincgi_interface::plaincgi_interface() { | 15 | plaincgi_interface::plaincgi_interface() { |
15 | for(char **p = environ; *p; p++) { | 16 | for(char **p = environ; *p; p++) { |
16 | const char *e = strchr(*p,'='); | 17 | const char *e = strchr(*p,'='); |
17 | if(!e){ | 18 | if(!e){ |
18 | // XXX: check if we have it already? | 19 | // XXX: check if we have it already? |
19 | metavars[*p] = string(0); | 20 | metavars[*p] = string(0); |
20 | }else{ | 21 | }else{ |
21 | int l = e-*p; e++; | 22 | int l = e-*p; e++; |
22 | // XXX: check if we have it already? | 23 | // XXX: check if we have it already? |
23 | metavars[string(*p,l)]=e; | 24 | metavars[string(*p,l)]=e; |
24 | } | 25 | } |
25 | } | 26 | } |
26 | } | 27 | } |
27 | plaincgi_interface::~plaincgi_interface() { | 28 | plaincgi_interface::~plaincgi_interface() { |
28 | cout.flush(); | 29 | cout.flush(); |
29 | cerr.flush(); | 30 | cerr.flush(); |
30 | } | 31 | } |
31 | 32 | ||
32 | } | 33 | } |