diff options
-rw-r--r-- | git.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -75,19 +75,19 @@ git_repository **init_git(config *cfg) { log(LOG_INFO, "Searching \"%s\" for repositories.", cfg->git_root); /* Find all git repos in the git root. */ while (readdir_r(root, &entry, &result) == 0 && result != NULL) { - log(LOG_DEBUG, "entry.d_name %s, result->d_name: %s", entry.d_name, result->d_name); + /*log(LOG_DEBUG, "entry.d_name: %s, result->d_name: %s", entry.d_name, result->d_name);*/ /* Is this entry a directory? */ if (entry.d_type == DT_DIR) { /* Is the entry neither ".", nor ".."? */ if (strcmp(entry.d_name, ".") && strcmp(entry.d_name, "..")) { - char *repo_dir = calloc(strlen(cfg->git_root) + strlen(entry.d_name) + 1, sizeof(char)); + char *repo_dir = calloc(strlen(cfg->git_root) + strlen(entry.d_name) + 2, sizeof(char)); /* Append the directory name to the git root. */ /* Could also do this: * memcpy(repo_dir, cfg->git_root, strlen(cfg->git_repo)); * strcat(repo_dir, entry.d_name); */ - sprintf(repo_dir, "%s%s", cfg->git_root, entry.d_name); + sprintf(repo_dir, "%s/%s", cfg->git_root, entry.d_name); /* Was no ignore file found? */ if (!find_ignore_file(repo_dir)) { /* Did we fail to open the git repo? */ |