Skip to contentSkip to conversation

path: for clarity, rename get_pathname to get_path_buffer

PATCH New Michal Nazarewicz 1 participant 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 path: for clarity, rename get_pathname to get_path_buffer

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.

---
 path.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
path.c +4 -4
index bc804a3..70e2f85 100644
@@ -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;
Signature · 1 line
2.0.0.526.g5318336
#1 lore raw

PATCH 1/1 path: for clarity, rename get_pathname to get_path_buffer

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.

---
 path.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

This time sent with Junio's correct address.

path.c +4 -4
index bc804a3..70e2f85 100644
@@ -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;
Signature · 1 line
2.0.0.526.g5318336