Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.zx2c4.com/cgit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@lfos.de>2016-10-08 16:45:12 +0300
committerJason A. Donenfeld <Jason@zx2c4.com>2016-10-12 15:13:10 +0300
commit32c27e887732298da1724c0740004925fcadae39 (patch)
treed2b46038cd3e3e8e483363d5aad535c7de063c79 /scan-tree.c
parent5fe88a9c81517b1a8a93d930c738cbb6f71dec2a (diff)
Use skip_prefix() to get rid of magic constants
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Diffstat (limited to 'scan-tree.c')
-rw-r--r--scan-tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/scan-tree.c b/scan-tree.c
index 1cb4e5d..08f3f1d 100644
--- a/scan-tree.c
+++ b/scan-tree.c
@@ -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;
}