diff options
Diffstat (limited to 'src/fileops.c')
-rw-r--r-- | src/fileops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fileops.c b/src/fileops.c index b7ae94b75..ba88dfec7 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -763,7 +763,8 @@ static int git_futils_find_in_dirlist( continue; GITERR_CHECK_ERROR(git_buf_set(path, scan, len)); - GITERR_CHECK_ERROR(git_buf_joinpath(path, path->ptr, name)); + if (name) + GITERR_CHECK_ERROR(git_buf_joinpath(path, path->ptr, name)); if (git_path_exists(path->ptr)) return 0; @@ -792,6 +793,12 @@ int git_futils_find_xdg_file(git_buf *path, const char *filename) path, filename, GIT_FUTILS_DIR_XDG, "global/xdg"); } +int git_futils_find_template_dir(git_buf *path) +{ + return git_futils_find_in_dirlist( + path, NULL, GIT_FUTILS_DIR_TEMPLATE, "template"); +} + int git_futils_fake_symlink(const char *old, const char *new) { int retcode = GIT_ERROR; |