Skip to content

Commit

Permalink
path.c: group git_path(), git_pathdup() and strbuf_git_path() together
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
pclouds authored and gitster committed Dec 1, 2014
1 parent 8afdaf3 commit 57a23b7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 57a23b7

Please sign in to comment.