Skip to content

Commit

Permalink
"current_exec_path" is a misleading name, use "argv_exec_path"
Browse files Browse the repository at this point in the history
Signed-off-by: Scott R Parish <srp@srparish.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
srp authored and gitster committed Oct 30, 2007
1 parent edb6ddc commit 384df83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions exec_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

extern char **environ;
static const char *builtin_exec_path = GIT_EXEC_PATH;
static const char *current_exec_path;
static const char *argv_exec_path;

void git_set_exec_path(const char *exec_path)
void git_set_argv_exec_path(const char *exec_path)
{
current_exec_path = exec_path;
argv_exec_path = exec_path;
}


Expand All @@ -18,8 +18,8 @@ const char *git_exec_path(void)
{
const char *env;

if (current_exec_path)
return current_exec_path;
if (argv_exec_path)
return argv_exec_path;

env = getenv(EXEC_PATH_ENVIRONMENT);
if (env && *env) {
Expand All @@ -34,7 +34,7 @@ int execv_git_cmd(const char **argv)
{
char git_command[PATH_MAX + 1];
int i;
const char *paths[] = { current_exec_path,
const char *paths[] = { argv_exec_path,
getenv(EXEC_PATH_ENVIRONMENT),
builtin_exec_path };

Expand Down
2 changes: 1 addition & 1 deletion exec_cmd.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef GIT_EXEC_CMD_H
#define GIT_EXEC_CMD_H

extern void git_set_exec_path(const char *exec_path);
extern void git_set_argv_exec_path(const char *exec_path);
extern const char* git_exec_path(void);
extern int execv_git_cmd(const char **argv); /* NULL terminated */
extern int execl_git_cmd(const char *cmd, ...);
Expand Down
2 changes: 1 addition & 1 deletion git.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
if (!prefixcmp(cmd, "--exec-path")) {
cmd += 11;
if (*cmd == '=')
git_set_exec_path(cmd + 1);
git_set_argv_exec_path(cmd + 1);
else {
puts(git_exec_path());
exit(0);
Expand Down

0 comments on commit 384df83

Please sign in to comment.