summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 15:24:30 +0700
committerJunio C Hamano <gitster@pobox.com>2014-12-01 11:00:11 -0800
commit57a23b770a839786f2eaae4a9dde779149bfb812 (patch)
tree8ff1fcbfc68aaaeb3a67f5c1f6f2e763a2fc573e /path.c
parent8afdaf39e318711dc05ad52ae6c227eaedf6c7ff (diff)
downloadgit-57a23b770a839786f2eaae4a9dde779149bfb812.tar.gz
path.c: group git_path(), git_pathdup() and strbuf_git_path() together
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.c')
-rw-r--r--path.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/path.c b/path.c
index 6991103d43..df0f75ba4f 100644
--- a/path.c
+++ b/path.c
@@ -78,6 +78,16 @@ void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
va_end(args);
}
+const char *git_path(const char *fmt, ...)
+{
+ struct strbuf *pathname = get_pathname();
+ va_list args;
+ va_start(args, fmt);
+ do_git_path(pathname, fmt, args);
+ va_end(args);
+ return pathname->buf;
+}
+
char *git_pathdup(const char *fmt, ...)
{
struct strbuf path = STRBUF_INIT;
@@ -109,16 +119,6 @@ const char *mkpath(const char *fmt, ...)
return cleanup_path(pathname->buf);
}
-const char *git_path(const char *fmt, ...)
-{
- struct strbuf *pathname = get_pathname();
- va_list args;
- va_start(args, fmt);
- do_git_path(pathname, fmt, args);
- va_end(args);
- return pathname->buf;
-}
-
void home_config_paths(char **global, char **xdg, char *file)
{
char *xdg_home = getenv("XDG_CONFIG_HOME");