diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2006-05-29 04:34:34 +0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-30 21:49:01 -0700 |
commit | 2b6016263c984b71b29373fc9354d497cd51947d (patch) | |
tree | c228d1c6f3f08c3d042c8ad51f75f3173e697cfc | |
parent | d6859901012535b3781e5332923ede51d5977395 (diff) | |
download | git-2b6016263c984b71b29373fc9354d497cd51947d.tar.gz |
git_exec_path, execv_git_cmd: ignore empty environment variables
Ignoring empty environment variables is good common practice.
Ignoring --exec-path with empty argument won't harm, too:
if user means current directory, there is a "--exec-path=."
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | exec_cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exec_cmd.c b/exec_cmd.c index 12eb36494c..c1539d12ce 100644 --- a/exec_cmd.c +++ b/exec_cmd.c @@ -21,7 +21,7 @@ const char *git_exec_path(void) return current_exec_path; env = getenv("GIT_EXEC_PATH"); - if (env) { + if (env && *env) { return env; } @@ -43,7 +43,7 @@ int execv_git_cmd(const char **argv) const char *exec_dir = paths[i]; const char *tmp; - if (!exec_dir) continue; + if (!exec_dir || !*exec_dir) continue; if (*exec_dir != '/') { if (!getcwd(git_command, sizeof(git_command))) { |