diff options
| author | Lukas Fleischer | 2016-10-08 15:45:12 +0200 |
|---|---|---|
| committer | Jason A. Donenfeld | 2016-10-12 14:13:10 +0200 |
| commit | 32c27e887732298da1724c0740004925fcadae39 (patch) | |
| tree | d2b46038cd3e3e8e483363d5aad535c7de063c79 /scan-tree.c | |
| parent | 5fe88a9c81517b1a8a93d930c738cbb6f71dec2a (diff) | |
| download | cgit-32c27e887732298da1724c0740004925fcadae39.tar.gz cgit-32c27e887732298da1724c0740004925fcadae39.tar.bz2 cgit-32c27e887732298da1724c0740004925fcadae39.zip | |
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.c | 6 |
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) | |||
| 55 | 55 | ||
| 56 | static int gitconfig_config(const char *key, const char *value, void *cb) | 56 | static int gitconfig_config(const char *key, const char *value, void *cb) |
| 57 | { | 57 | { |
| 58 | const char *name; | ||
| 59 | |||
| 58 | if (!strcmp(key, "gitweb.owner")) | 60 | if (!strcmp(key, "gitweb.owner")) |
| 59 | config_fn(repo, "owner", value); | 61 | config_fn(repo, "owner", value); |
| 60 | else if (!strcmp(key, "gitweb.description")) | 62 | else if (!strcmp(key, "gitweb.description")) |
| @@ -63,8 +65,8 @@ static int gitconfig_config(const char *key, const char *value, void *cb) | |||
| 63 | config_fn(repo, "section", value); | 65 | config_fn(repo, "section", value); |
| 64 | else if (!strcmp(key, "gitweb.homepage")) | 66 | else if (!strcmp(key, "gitweb.homepage")) |
| 65 | config_fn(repo, "homepage", value); | 67 | config_fn(repo, "homepage", value); |
| 66 | else if (starts_with(key, "cgit.")) | 68 | else if (skip_prefix(key, "cgit.", &name)) |
| 67 | config_fn(repo, key + 5, value); | 69 | config_fn(repo, name, value); |
| 68 | 70 | ||
| 69 | return 0; | 71 | return 0; |
| 70 | } | 72 | } |
