From 379e80e3a83481d3639c5d312eeddcce57c486b2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 4 Aug 2010 00:45:42 +0200 Subject: Support refspecs in about-filter. Signed-off-by: Jason A. Donenfeld Signed-off-by: Lars Hjemli --- cgit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index eff5b7a..4f2c752 100644 --- a/cgit.c +++ b/cgit.c @@ -1,6 +1,7 @@ /* cgit.c: cgi for the git scm * * Copyright (C) 2006 Lars Hjemli + * Copyright (C) 2010 Jason A. Donenfeld * * Licensed under GNU General Public License v2 * (see COPYING for full license text) @@ -71,7 +72,8 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *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)); -- cgit v1.2.3-59-g8ed1b