summaryrefslogtreecommitdiffabout
path: root/scan-tree.c
Unidiff
Diffstat (limited to 'scan-tree.c') (more/less context) (ignore whitespace changes)
-rw-r--r--scan-tree.c2
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
@@ -70,33 +70,33 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn)
70 p[strlen(p) - 5] = '\0'; 70 p[strlen(p) - 5] = '\0';
71 71
72 repo = cgit_add_repo(xstrdup(p)); 72 repo = cgit_add_repo(xstrdup(p));
73 repo->name = repo->url; 73 repo->name = repo->url;
74 repo->path = xstrdup(path); 74 repo->path = xstrdup(path);
75 p = (pwd && pwd->pw_gecos) ? strchr(pwd->pw_gecos, ',') : NULL; 75 p = (pwd && pwd->pw_gecos) ? strchr(pwd->pw_gecos, ',') : NULL;
76 if (p) 76 if (p)
77 *p = '\0'; 77 *p = '\0';
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
95static void scan_path(const char *base, const char *path, repo_config_fn fn) 95static void scan_path(const char *base, const char *path, repo_config_fn fn)
96{ 96{
97 DIR *dir; 97 DIR *dir;
98 struct dirent *ent; 98 struct dirent *ent;
99 char *buf; 99 char *buf;
100 struct stat st; 100 struct stat st;
101 101
102 if (is_git_dir(path)) { 102 if (is_git_dir(path)) {