diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-08-02 16:33:25 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-08-02 16:33:25 -0400 |
commit | fdc6c1310be60fbeb597400618473861f78676de (patch) | |
tree | 201d14d77f7f944545809bff02ae45fc826bb7e7 /src/c/cgi.c | |
parent | 722b0c632007ac6ea178b05695974e447b4288a3 (diff) |
Basis.getenv
Diffstat (limited to 'src/c/cgi.c')
-rw-r--r-- | src/c/cgi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/c/cgi.c b/src/c/cgi.c index 6d6e5252..d3ec32c7 100644 --- a/src/c/cgi.c +++ b/src/c/cgi.c @@ -1,6 +1,7 @@ #include "config.h" #include <stdio.h> +#include <stdlib.h> #include <ctype.h> #include <string.h> #include <stdlib.h> @@ -39,6 +40,10 @@ static char *get_header(void *data, const char *h) { return NULL; } +static char *get_env(void *data, const char *name) { + return getenv(name); +} + static void on_success(uw_context ctx) { } static void on_failure(uw_context ctx) { @@ -102,6 +107,7 @@ int main(int argc, char *argv[]) { uw_set_on_success(""); uw_set_headers(ctx, get_header, NULL); + uw_set_env(ctx, get_env, NULL); uw_request_init(&uw_application, NULL, log_error, log_debug); body[body_pos] = 0; |