summaryrefslogtreecommitdiffabout
path: root/cgit.c
authorLars Hjemli <hjemli@gmail.com>2009-12-08 18:32:48 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-12-08 18:32:48 (UTC)
commitf4f6210b4f9c214dc247567bbd06b1135c9ecd06 (patch) (unidiff)
tree432b3dc327e05220c6ac0aff9ca81cf38a47524c /cgit.c
parent57bb4fdb8419d7c250d4c6146910df3263943951 (diff)
parent735e15e38a484bf0daa98776fa7cde270a271cda (diff)
downloadcgit-f4f6210b4f9c214dc247567bbd06b1135c9ecd06.zip
cgit-f4f6210b4f9c214dc247567bbd06b1135c9ecd06.tar.gz
cgit-f4f6210b4f9c214dc247567bbd06b1135c9ecd06.tar.bz2
Merge branch 'ro/ssdiff'
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 08cb5d2..4f68a4b 100644
--- a/cgit.c
+++ b/cgit.c
@@ -179,16 +179,18 @@ void config_cb(const char *name, const char *value)
179 else if (!strcmp(name, "source-filter")) 179 else if (!strcmp(name, "source-filter"))
180 ctx.cfg.source_filter = new_filter(value, 1); 180 ctx.cfg.source_filter = new_filter(value, 1);
181 else if (!strcmp(name, "summary-log")) 181 else if (!strcmp(name, "summary-log"))
182 ctx.cfg.summary_log = atoi(value); 182 ctx.cfg.summary_log = atoi(value);
183 else if (!strcmp(name, "summary-branches")) 183 else if (!strcmp(name, "summary-branches"))
184 ctx.cfg.summary_branches = atoi(value); 184 ctx.cfg.summary_branches = atoi(value);
185 else if (!strcmp(name, "summary-tags")) 185 else if (!strcmp(name, "summary-tags"))
186 ctx.cfg.summary_tags = atoi(value); 186 ctx.cfg.summary_tags = atoi(value);
187 else if (!strcmp(name, "side-by-side-diffs"))
188 ctx.cfg.ssdiff = atoi(value);
187 else if (!strcmp(name, "agefile")) 189 else if (!strcmp(name, "agefile"))
188 ctx.cfg.agefile = xstrdup(value); 190 ctx.cfg.agefile = xstrdup(value);
189 else if (!strcmp(name, "renamelimit")) 191 else if (!strcmp(name, "renamelimit"))
190 ctx.cfg.renamelimit = atoi(value); 192 ctx.cfg.renamelimit = atoi(value);
191 else if (!strcmp(name, "robots")) 193 else if (!strcmp(name, "robots"))
192 ctx.cfg.robots = xstrdup(value); 194 ctx.cfg.robots = xstrdup(value);
193 else if (!strcmp(name, "clone-prefix")) 195 else if (!strcmp(name, "clone-prefix"))
194 ctx.cfg.clone_prefix = xstrdup(value); 196 ctx.cfg.clone_prefix = xstrdup(value);
@@ -237,16 +239,18 @@ static void querystring_cb(const char *name, const char *value)
237 } else if (!strcmp(name, "mimetype")) { 239 } else if (!strcmp(name, "mimetype")) {
238 ctx.qry.mimetype = xstrdup(value); 240 ctx.qry.mimetype = xstrdup(value);
239 } else if (!strcmp(name, "s")){ 241 } else if (!strcmp(name, "s")){
240 ctx.qry.sort = xstrdup(value); 242 ctx.qry.sort = xstrdup(value);
241 } else if (!strcmp(name, "showmsg")) { 243 } else if (!strcmp(name, "showmsg")) {
242 ctx.qry.showmsg = atoi(value); 244 ctx.qry.showmsg = atoi(value);
243 } else if (!strcmp(name, "period")) { 245 } else if (!strcmp(name, "period")) {
244 ctx.qry.period = xstrdup(value); 246 ctx.qry.period = xstrdup(value);
247 } else if (!strcmp(name, "ss")) {
248 ctx.qry.ssdiff = atoi(value);
245 } 249 }
246} 250}
247 251
248char *xstrdupn(const char *str) 252char *xstrdupn(const char *str)
249{ 253{
250 return (str ? xstrdup(str) : NULL); 254 return (str ? xstrdup(str) : NULL);
251} 255}
252 256
@@ -279,16 +283,17 @@ static void prepare_context(struct cgit_context *ctx)
279 ctx->cfg.robots = "index, nofollow"; 283 ctx->cfg.robots = "index, nofollow";
280 ctx->cfg.root_title = "Git repository browser"; 284 ctx->cfg.root_title = "Git repository browser";
281 ctx->cfg.root_desc = "a fast webinterface for the git dscm"; 285 ctx->cfg.root_desc = "a fast webinterface for the git dscm";
282 ctx->cfg.script_name = CGIT_SCRIPT_NAME; 286 ctx->cfg.script_name = CGIT_SCRIPT_NAME;
283 ctx->cfg.section = ""; 287 ctx->cfg.section = "";
284 ctx->cfg.summary_branches = 10; 288 ctx->cfg.summary_branches = 10;
285 ctx->cfg.summary_log = 10; 289 ctx->cfg.summary_log = 10;
286 ctx->cfg.summary_tags = 10; 290 ctx->cfg.summary_tags = 10;
291 ctx->cfg.ssdiff = 0;
287 ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); 292 ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG"));
288 ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); 293 ctx->env.http_host = xstrdupn(getenv("HTTP_HOST"));
289 ctx->env.https = xstrdupn(getenv("HTTPS")); 294 ctx->env.https = xstrdupn(getenv("HTTPS"));
290 ctx->env.no_http = xstrdupn(getenv("NO_HTTP")); 295 ctx->env.no_http = xstrdupn(getenv("NO_HTTP"));
291 ctx->env.path_info = xstrdupn(getenv("PATH_INFO")); 296 ctx->env.path_info = xstrdupn(getenv("PATH_INFO"));
292 ctx->env.query_string = xstrdupn(getenv("QUERY_STRING")); 297 ctx->env.query_string = xstrdupn(getenv("QUERY_STRING"));
293 ctx->env.request_method = xstrdupn(getenv("REQUEST_METHOD")); 298 ctx->env.request_method = xstrdupn(getenv("REQUEST_METHOD"));
294 ctx->env.script_name = xstrdupn(getenv("SCRIPT_NAME")); 299 ctx->env.script_name = xstrdupn(getenv("SCRIPT_NAME"));