Use skip_prefix() to get rid of magic constants

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Tá an tiomantas seo le fáil i:
Lukas Fleischer
2016-10-08 15:45:12 +02:00
tiomanta ag Jason A. Donenfeld
tuismitheoir 5fe88a9c81
tiomantas 32c27e8877
D'athraigh 2 comhad le 34 breiseanna agus 28 scriosta

Féach ar an gComhad

@ -55,6 +55,8 @@ static void repo_config(const char *name, const char *value)
static int gitconfig_config(const char *key, const char *value, void *cb)
{
const char *name;
if (!strcmp(key, "gitweb.owner"))
config_fn(repo, "owner", value);
else if (!strcmp(key, "gitweb.description"))
@ -63,8 +65,8 @@ static int gitconfig_config(const char *key, const char *value, void *cb)
config_fn(repo, "section", value);
else if (!strcmp(key, "gitweb.homepage"))
config_fn(repo, "homepage", value);
else if (starts_with(key, "cgit."))
config_fn(repo, key + 5, value);
else if (skip_prefix(key, "cgit.", &name))
config_fn(repo, name, value);
return 0;
}