author | Lars Hjemli <hjemli@gmail.com> | 2010-09-19 16:43:58 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-09-19 16:43:58 (UTC) |
commit | e76a1ea427792aaa331cdec70d7d4ff1fb3422e0 (patch) (unidiff) | |
tree | faeee0c46a2d470b29b46481f74070557e3fdb8d /scan-tree.c | |
parent | 857696dd3d85f7c12c718a46d82a2405e6a9919a (diff) | |
parent | 515edb0da3b9156e07e269621d7474cdea82acaf (diff) | |
download | cgit-e76a1ea427792aaa331cdec70d7d4ff1fb3422e0.zip cgit-e76a1ea427792aaa331cdec70d7d4ff1fb3422e0.tar.gz cgit-e76a1ea427792aaa331cdec70d7d4ff1fb3422e0.tar.bz2 |
Merge branch 'lh/readme'
-rw-r--r-- | scan-tree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scan-tree.c b/scan-tree.c index e987824..780d405 100644 --- a/scan-tree.c +++ b/scan-tree.c | |||
@@ -101,27 +101,29 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn) | |||
101 | } | 101 | } |
102 | if (pwd->pw_gecos) | 102 | if (pwd->pw_gecos) |
103 | if ((p = strchr(pwd->pw_gecos, ','))) | 103 | if ((p = strchr(pwd->pw_gecos, ','))) |
104 | *p = '\0'; | 104 | *p = '\0'; |
105 | owner = xstrdup(pwd->pw_gecos ? pwd->pw_gecos : pwd->pw_name); | 105 | owner = xstrdup(pwd->pw_gecos ? pwd->pw_gecos : pwd->pw_name); |
106 | } | 106 | } |
107 | repo->owner = owner; | 107 | repo->owner = owner; |
108 | 108 | ||
109 | p = fmt("%s/description", path); | 109 | p = fmt("%s/description", path); |
110 | if (!stat(p, &st)) | 110 | if (!stat(p, &st)) |
111 | readfile(p, &repo->desc, &size); | 111 | readfile(p, &repo->desc, &size); |
112 | 112 | ||
113 | p = fmt("%s/README.html", path); | 113 | if (!repo->readme) { |
114 | if (!stat(p, &st)) | 114 | p = fmt("%s/README.html", path); |
115 | repo->readme = "README.html"; | 115 | if (!stat(p, &st)) |
116 | repo->readme = "README.html"; | ||
117 | } | ||
116 | 118 | ||
117 | p = fmt("%s/cgitrc", path); | 119 | p = fmt("%s/cgitrc", path); |
118 | if (!stat(p, &st)) { | 120 | if (!stat(p, &st)) { |
119 | config_fn = fn; | 121 | config_fn = fn; |
120 | parse_configfile(xstrdup(p), &repo_config); | 122 | parse_configfile(xstrdup(p), &repo_config); |
121 | } | 123 | } |
122 | } | 124 | } |
123 | 125 | ||
124 | static void scan_path(const char *base, const char *path, repo_config_fn fn) | 126 | static void scan_path(const char *base, const char *path, repo_config_fn fn) |
125 | { | 127 | { |
126 | DIR *dir; | 128 | DIR *dir; |
127 | struct dirent *ent; | 129 | struct dirent *ent; |