summaryrefslogtreecommitdiffabout
path: root/src/plaincgi.cc
authorMichael Krelin <hacker@klever.net>2005-02-13 21:48:37 (UTC)
committer Michael Krelin <hacker@klever.net>2005-02-13 21:48:37 (UTC)
commitace26447603d3f7ecd82fd3910174f603c2c7464 (patch) (unidiff)
tree3a82346bd7fff177f74424ed61a6a2c6aa7a308e /src/plaincgi.cc
parent4fa4a0071ef9a04c02f8934b2e1d3b7628a65c80 (diff)
downloadkingate-ace26447603d3f7ecd82fd3910174f603c2c7464.zip
kingate-ace26447603d3f7ecd82fd3910174f603c2c7464.tar.gz
kingate-ace26447603d3f7ecd82fd3910174f603c2c7464.tar.bz2
portabiity improvements
Diffstat (limited to 'src/plaincgi.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--src/plaincgi.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plaincgi.cc b/src/plaincgi.cc
index 6934748..1cb7dc6 100644
--- a/src/plaincgi.cc
+++ b/src/plaincgi.cc
@@ -1,21 +1,26 @@
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 "kingate/plaincgi.h" 4#include "kingate/plaincgi.h"
5#include "kingate/exception.h" 5#include "kingate/exception.h"
6#include "config.h"
7
8#if !HAVE_DECL_ENVIRON
9extern char **environ;
10#endif /* HAVE_DECL_ENVIRON */
6 11
7namespace kingate { 12namespace kingate {
8 13
9 plaincgi_interface::plaincgi_interface() { 14 plaincgi_interface::plaincgi_interface() {
10 for(char **p = environ; *p; p++) { 15 for(char **p = environ; *p; p++) {
11 const char *e = strchr(*p,'='); 16 const char *e = strchr(*p,'=');
12 if(!e){ 17 if(!e){
13 // XXX: check if we have it already? 18 // XXX: check if we have it already?
14 metavars[*p] = string(0); 19 metavars[*p] = string(0);
15 }else{ 20 }else{
16 int l = e-*p; e++; 21 int l = e-*p; e++;
17 // XXX: check if we have it already? 22 // XXX: check if we have it already?
18 metavars[string(*p,l)]=e; 23 metavars[string(*p,l)]=e;
19 } 24 }
20 } 25 }
21 } 26 }