aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgit.c4
-rw-r--r--cgit.h20
2 files changed, 12 insertions, 12 deletions
diff --git a/cgit.c b/cgit.c
index afafcce..d145f8a 100644
--- a/cgit.c
+++ b/cgit.c
@@ -401,9 +401,9 @@ static void prepare_context(struct cgit_context *ctx)
ctx->page.etag = NULL;
memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list));
if (ctx->env.script_name)
- ctx->cfg.script_name = ctx->env.script_name;
+ ctx->cfg.script_name = xstrdup(ctx->env.script_name);
if (ctx->env.query_string)
- ctx->qry.raw = ctx->env.query_string;
+ ctx->qry.raw = xstrdup(ctx->env.query_string);
if (!ctx->env.cgit_config)
ctx->env.cgit_config = CGIT_CONFIG;
}
diff --git a/cgit.h b/cgit.h
index ed5cf14..081f669 100644
--- a/cgit.h
+++ b/cgit.h
@@ -255,16 +255,16 @@ struct cgit_page {
};
struct cgit_environment {
- char *cgit_config;
- char *http_host;
- char *https;
- char *no_http;
- char *path_info;
- char *query_string;
- char *request_method;
- char *script_name;
- char *server_name;
- char *server_port;
+ const char *cgit_config;
+ const char *http_host;
+ const char *https;
+ const char *no_http;
+ const char *path_info;
+ const char *query_string;
+ const char *request_method;
+ const char *script_name;
+ const char *server_name;
+ const char *server_port;
};
struct cgit_context {