aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cgit.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/cgit.c b/cgit.c
index d145f8a..ca3034c 100644
--- a/cgit.c
+++ b/cgit.c
@@ -333,11 +333,6 @@ static void querystring_cb(const char *name, const char *value)
333 } 333 }
334} 334}
335 335
336static char *xstrdupn(const char *str)
337{
338 return (str ? xstrdup(str) : NULL);
339}
340
341static void prepare_context(struct cgit_context *ctx) 336static void prepare_context(struct cgit_context *ctx)
342{ 337{
343 memset(ctx, 0, sizeof(*ctx)); 338 memset(ctx, 0, sizeof(*ctx));
@@ -382,16 +377,16 @@ static void prepare_context(struct cgit_context *ctx)
382 ctx->cfg.summary_tags = 10; 377 ctx->cfg.summary_tags = 10;
383 ctx->cfg.max_atom_items = 10; 378 ctx->cfg.max_atom_items = 10;
384 ctx->cfg.ssdiff = 0; 379 ctx->cfg.ssdiff = 0;
385 ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); 380 ctx->env.cgit_config = getenv("CGIT_CONFIG");
386 ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); 381 ctx->env.http_host = getenv("HTTP_HOST");
387 ctx->env.https = xstrdupn(getenv("HTTPS")); 382 ctx->env.https = getenv("HTTPS");
388 ctx->env.no_http = xstrdupn(getenv("NO_HTTP")); 383 ctx->env.no_http = getenv("NO_HTTP");
389 ctx->env.path_info = xstrdupn(getenv("PATH_INFO")); 384 ctx->env.path_info = getenv("PATH_INFO");
390 ctx->env.query_string = xstrdupn(getenv("QUERY_STRING")); 385 ctx->env.query_string = getenv("QUERY_STRING");
391 ctx->env.request_method = xstrdupn(getenv("REQUEST_METHOD")); 386 ctx->env.request_method = getenv("REQUEST_METHOD");
392 ctx->env.script_name = xstrdupn(getenv("SCRIPT_NAME")); 387 ctx->env.script_name = getenv("SCRIPT_NAME");
393 ctx->env.server_name = xstrdupn(getenv("SERVER_NAME")); 388 ctx->env.server_name = getenv("SERVER_NAME");
394 ctx->env.server_port = xstrdupn(getenv("SERVER_PORT")); 389 ctx->env.server_port = getenv("SERVER_PORT");
395 ctx->page.mimetype = "text/html"; 390 ctx->page.mimetype = "text/html";
396 ctx->page.charset = PAGE_ENCODING; 391 ctx->page.charset = PAGE_ENCODING;
397 ctx->page.filename = NULL; 392 ctx->page.filename = NULL;