summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-13 19:18:51 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-13 19:18:51 -0400
commiteb837924ce196ae22b8d295a0072102b3a104406 (patch)
treebe5b226ab06bb267e54494191260fea197f90046 /git.c
parent67f802db79ab9fb088263119692076c9e4e28f42 (diff)
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.
Diffstat (limited to 'git.c')
-rw-r--r--git.c6
1 files 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? */