Skip to content

Commit 12d858a

Browse files
committed
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
2 parents 3e06f5f + a785508 commit 12d858a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

run-command.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ int sane_execvp(const char *file, char * const argv[])
139139
*/
140140
if (errno == EACCES && !strchr(file, '/'))
141141
errno = exists_in_PATH(file) ? EACCES : ENOENT;
142+
else if (errno == ENOTDIR && !strchr(file, '/'))
143+
errno = ENOENT;
142144
return -1;
143145
}
144146

0 commit comments

Comments
 (0)