From eb837924ce196ae22b8d295a0072102b3a104406 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 13 Jun 2021 19:18:51 -0400 Subject: Fixed a typo with appending the directory name to the git root, and also comment out a debug log message. I forgot to add a `/` oof. --- git.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git.c b/git.c index 03bbb5f..25e6970 100644 --- a/git.c +++ b/git.c @@ -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? */ -- cgit v1.2.3-13-gbd6f