Skip to content

Commit fe77b69

Browse files
Eric Raiblegitster
authored andcommitted
Teach lookup_prog not to select directories
Without this simple fix "git gui" in the git source directory finds the git-gui directory instead of the tcl script in /usr/bin. Signed-off-by: Eric Raible <raible@gmail.com> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 42f7a2d commit fe77b69

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compat/mingw.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ static char *lookup_prog(const char *dir, const char *cmd, int isexe, int exe_on
536536
return xstrdup(path);
537537
path[strlen(path)-4] = '\0';
538538
if ((!exe_only || isexe) && access(path, F_OK) == 0)
539-
return xstrdup(path);
539+
if (!(GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY))
540+
return xstrdup(path);
540541
return NULL;
541542
}
542543

0 commit comments

Comments
 (0)