From: Michal Nazarewicz <mina86@mina86•com>
To: Linus Torvalds <torvalds@osdl•org>, Junio C Hamano <junkio@cox•net>
Cc: git@vger•kernel.org
Subject: [PATCH] path: for clarity, rename get_pathname to get_path_buffer
Date: Tue, 08 Jul 2014 14:35:13 +0200 [thread overview]
Message-ID: <xa1ta98k58qm.fsf@mina86.com> (raw)
The get_pathname function does not really return path name but rather
a buffer to store pathname in. As such, current name is a bit
confusing. Change the name as to make it clearer what the function is
doing.
Signed-off-by: Michal Nazarewicz <mina86@mina86•com>
---
path.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/path.c b/path.c
index bc804a3..70e2f85 100644
--- a/path.c
+++ b/path.c
@@ -16,7 +16,7 @@ static int get_st_mode_bits(const char *path, int *mode)
static char bad_path[] = "/bad-path/";
-static char *get_pathname(void)
+static char *get_path_buffer(void)
{
static char pathname_array[4][PATH_MAX];
static int index;
@@ -108,7 +108,7 @@ char *mkpath(const char *fmt, ...)
{
va_list args;
unsigned len;
- char *pathname = get_pathname();
+ char *pathname = get_path_buffer();
va_start(args, fmt);
len = vsnprintf(pathname, PATH_MAX, fmt, args);
@@ -120,7 +120,7 @@ char *mkpath(const char *fmt, ...)
char *git_path(const char *fmt, ...)
{
- char *pathname = get_pathname();
+ char *pathname = get_path_buffer();
va_list args;
char *ret;
@@ -158,7 +158,7 @@ void home_config_paths(char **global, char **xdg, char *file)
char *git_path_submodule(const char *path, const char *fmt, ...)
{
- char *pathname = get_pathname();
+ char *pathname = get_path_buffer();
struct strbuf buf = STRBUF_INIT;
const char *git_dir;
va_list args;
--
2.0.0.526.g5318336
next reply other threads:[~2014-07-08 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 12:35 Michal Nazarewicz [this message]
2014-07-08 13:15 ` [PATCH] path: for clarity, rename get_pathname to get_path_buffer Michal Nazarewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xa1ta98k58qm.fsf@mina86.com \
--to=mina86@mina86$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=junkio@cox$(echo .)net \
--cc=torvalds@osdl$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox