author | Dean Scarff <dos@scarff.id.au> | 2010-08-26 07:01:20 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-11-07 15:21:59 (UTC) |
commit | aabc70f74b8c334510774ecd508699c418f48a56 (patch) (unidiff) | |
tree | 38581a70a9e8dba766e99124e2c5e69cf97a595a | |
parent | af492114ccf6d5ab72890277ad828cf6d9fa8909 (diff) | |
download | cgit-aabc70f74b8c334510774ecd508699c418f48a56.zip cgit-aabc70f74b8c334510774ecd508699c418f48a56.tar.gz cgit-aabc70f74b8c334510774ecd508699c418f48a56.tar.bz2 |
Use absolute path for scanned repo readme
repo.readme is transformed to an absolute path when read from the config,
so add_repo needs to add "README.html" with the repository path too.
Signed-off-by: Dean Scarff <dos@scarff.id.au>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | scan-tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scan-tree.c b/scan-tree.c index dbca797..ebfd41e 100644 --- a/scan-tree.c +++ b/scan-tree.c | |||
@@ -78,17 +78,17 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn) | |||
78 | repo->owner = (pwd ? xstrdup(pwd->pw_gecos ? pwd->pw_gecos : pwd->pw_name) : ""); | 78 | repo->owner = (pwd ? xstrdup(pwd->pw_gecos ? pwd->pw_gecos : pwd->pw_name) : ""); |
79 | 79 | ||
80 | p = fmt("%s/description", path); | 80 | p = fmt("%s/description", path); |
81 | if (!stat(p, &st)) | 81 | if (!stat(p, &st)) |
82 | readfile(p, &repo->desc, &size); | 82 | readfile(p, &repo->desc, &size); |
83 | 83 | ||
84 | p = fmt("%s/README.html", path); | 84 | p = fmt("%s/README.html", path); |
85 | if (!stat(p, &st)) | 85 | if (!stat(p, &st)) |
86 | repo->readme = "README.html"; | 86 | repo->readme = xstrdup(p); |
87 | 87 | ||
88 | p = fmt("%s/cgitrc", path); | 88 | p = fmt("%s/cgitrc", path); |
89 | if (!stat(p, &st)) { | 89 | if (!stat(p, &st)) { |
90 | config_fn = fn; | 90 | config_fn = fn; |
91 | parse_configfile(xstrdup(p), &repo_config); | 91 | parse_configfile(xstrdup(p), &repo_config); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||