diff options
author | Lars Hjemli | 2008-03-28 00:09:11 +0100 |
---|---|---|
committer | Lars Hjemli | 2008-03-28 00:09:11 +0100 |
commit | 20a33548b9a87a6eb23162ee5d137daa46d78613 (patch) | |
tree | 9c4ca364df64dcce640a531c7f515ee48bc99387 /cgit.c | |
parent | ee4056bd2c902a12dea67874368863fe60ea5a5f (diff) | |
download | cgit-20a33548b9a87a6eb23162ee5d137daa46d78613.tar.gz cgit-20a33548b9a87a6eb23162ee5d137daa46d78613.tar.bz2 cgit-20a33548b9a87a6eb23162ee5d137daa46d78613.zip |
Move function for configfile parsing into configfile.[ch]
This is a generic function which wanted its own little object file.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.c')
-rw-r--r-- | cgit.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -9,6 +9,7 @@ | |||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "cache.h" | 10 | #include "cache.h" |
11 | #include "cmd.h" | 11 | #include "cmd.h" |
12 | #include "configfile.h" | ||
12 | #include "ui-shared.h" | 13 | #include "ui-shared.h" |
13 | 14 | ||
14 | const char *cgit_version = CGIT_VERSION; | 15 | const char *cgit_version = CGIT_VERSION; |
@@ -103,7 +104,7 @@ void config_cb(const char *name, const char *value) | |||
103 | else | 104 | else |
104 | ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); | 105 | ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); |
105 | } else if (!strcmp(name, "include")) | 106 | } else if (!strcmp(name, "include")) |
106 | cgit_read_config(value, config_cb); | 107 | parse_configfile(value, config_cb); |
107 | } | 108 | } |
108 | 109 | ||
109 | static void querystring_cb(const char *name, const char *value) | 110 | static void querystring_cb(const char *name, const char *value) |
@@ -436,7 +437,7 @@ int main(int argc, const char **argv) | |||
436 | cgit_repolist.count = 0; | 437 | cgit_repolist.count = 0; |
437 | cgit_repolist.repos = NULL; | 438 | cgit_repolist.repos = NULL; |
438 | 439 | ||
439 | cgit_read_config(cgit_config_env ? cgit_config_env : CGIT_CONFIG, | 440 | parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG, |
440 | config_cb); | 441 | config_cb); |
441 | if (getenv("SCRIPT_NAME")) | 442 | if (getenv("SCRIPT_NAME")) |
442 | ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME")); | 443 | ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME")); |