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>
Nguyễn Thái Ngọc Duy committed
Nov 30, 2014 at 15:24 UTC
57a23b770a839786f2eaae4a9dde779149bfb812
1 file changed
+10
-10
path.c
+10
-10
@@ -78,6 +78,16 @@ void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
78
va_end(args);
79
}
80
81
+const char *git_path(const char *fmt, ...)
82
+{
83
+ struct strbuf *pathname = get_pathname();
84
+ va_list args;
85
+ va_start(args, fmt);
86
+ do_git_path(pathname, fmt, args);
87
+ va_end(args);
88
+ return pathname->buf;
89
+}
90
+
91
char *git_pathdup(const char *fmt, ...)
92
{
93
struct strbuf path = STRBUF_INIT;
@@ -109,16 +119,6 @@ const char *mkpath(const char *fmt, ...)
119
return cleanup_path(pathname->buf);
120
}
121
112
-const char *git_path(const char *fmt, ...)
113
-{
114
- struct strbuf *pathname = get_pathname();
115
- va_list args;
116
- va_start(args, fmt);
117
- do_git_path(pathname, fmt, args);
118
- va_end(args);
119
- return pathname->buf;
120
-}
121
-
122
void home_config_paths(char **global, char **xdg, char *file)
123
{
124
char *xdg_home = getenv("XDG_CONFIG_HOME");