summaryrefslogtreecommitdiff
path: root/exec_cmd.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2006-05-29 00:34:34 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-05-31 04:49:01 (GMT)
commit2b6016263c984b71b29373fc9354d497cd51947d (patch)
treec228d1c6f3f08c3d042c8ad51f75f3173e697cfc /exec_cmd.c
parentd6859901012535b3781e5332923ede51d5977395 (diff)
downloadgit-2b6016263c984b71b29373fc9354d497cd51947d.zip
git-2b6016263c984b71b29373fc9354d497cd51947d.tar.gz
git-2b6016263c984b71b29373fc9354d497cd51947d.tar.bz2
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>
Diffstat (limited to 'exec_cmd.c')
-rw-r--r--exec_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/exec_cmd.c b/exec_cmd.c
index 12eb364..c1539d1 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))) {