summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-03 15:53:26 -0700
committerJunio C Hamano <gitster@pobox.com>2012-09-03 15:53:26 -0700
commit12d858aeb45f6eae3eaecb49ccb6f61affca54cd (patch)
treea6a06df2210d7496665406a71df4796f9afd919f /run-command.c
parent3e06f5ff3870279f3bf2f97d4a4256032575055e (diff)
parenta78550831a42db6896e598cd2a8bfb441a958fc8 (diff)
downloadgit-12d858aeb45f6eae3eaecb49ccb6f61affca54cd.tar.gz
Merge branch 'jc/maint-sane-execvp-notdir'
"git foo" errored out with "Not a directory" when the user had a non directory on $PATH, and worse yet it masked an alias "foo" to run. * jc/maint-sane-execvp-notdir: sane_execvp(): ignore non-directory on $PATH
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 606791dc67..f9922b9ecc 100644
--- a/run-command.c
+++ b/run-command.c
@@ -139,6 +139,8 @@ int sane_execvp(const char *file, char * const argv[])
*/
if (errno == EACCES && !strchr(file, '/'))
errno = exists_in_PATH(file) ? EACCES : ENOENT;
+ else if (errno == ENOTDIR && !strchr(file, '/'))
+ errno = ENOENT;
return -1;
}