-rw-r--r-- | scan-tree.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/scan-tree.c b/scan-tree.c index 47f3988..95dc65b 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -37,15 +37,2 @@ static int is_git_dir(const char *path) -char *readfile(const char *path) -{ - FILE *f; - static char buf[MAX_PATH]; - - if (!(f = fopen(path, "r"))) - return NULL; - buf[0] = 0; - fgets(buf, MAX_PATH, f); - fclose(f); - return buf; -} - static void add_repo(const char *base, const char *path) @@ -56,2 +43,3 @@ static void add_repo(const char *base, const char *path) char *p; + size_t size; @@ -82,3 +70,3 @@ static void add_repo(const char *base, const char *path) if (!stat(p, &st)) - repo->desc = xstrdup(readfile(p)); + readfile(p, &repo->desc, &size); |