summaryrefslogtreecommitdiffabout
path: root/cgit.c
authorJason A. Donenfeld <Jason@zx2c4.com>2010-08-03 22:45:42 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2010-08-20 16:57:30 (UTC)
commit379e80e3a83481d3639c5d312eeddcce57c486b2 (patch) (side-by-side diff)
tree474ac38e3812008532d4ebd0b095ac835b5478b5 /cgit.c
parentaec9c245e7eaf444c7ae1851e3eda3b30748950f (diff)
downloadcgit-379e80e3a83481d3639c5d312eeddcce57c486b2.zip
cgit-379e80e3a83481d3639c5d312eeddcce57c486b2.tar.gz
cgit-379e80e3a83481d3639c5d312eeddcce57c486b2.tar.bz2
Support refspecs in about-filter.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgit.c b/cgit.c
index eff5b7a..4f2c752 100644
--- a/cgit.c
+++ b/cgit.c
@@ -1,9 +1,10 @@
/* cgit.c: cgi for the git scm
*
* Copyright (C) 2006 Lars Hjemli
+ * Copyright (C) 2010 Jason A. Donenfeld <Jason@zx2c4.com>
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
*/
#include "cgit.h"
@@ -68,13 +69,14 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
repo->max_stats = cgit_find_stats_period(value, NULL);
else if (!strcmp(name, "module-link"))
repo->module_link= xstrdup(value);
else if (!strcmp(name, "section"))
repo->section = xstrdup(value);
else if (!strcmp(name, "readme") && value != NULL) {
- if (*value == '/')
+ char *colon;
+ if (*value == '/' || ((colon = strchr(value, ':')) != NULL && colon != value && *(colon + 1) != '\0'))
repo->readme = xstrdup(value);
else
repo->readme = xstrdup(fmt("%s/%s", repo->path, value));
} else if (ctx.cfg.enable_filter_overrides) {
if (!strcmp(name, "about-filter"))
repo->about_filter = new_filter(value, 0);