fix mingw stat() and lstat() implementations for handling symlinks
commitfb2eae98355f87b18b7d16026823ab8854cf6beb
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 17 Mar 2010 15:17:34 +0000 (17 15:17 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 20 Sep 2010 14:53:09 +0000 (20 15:53 +0100)
treee37f42b3d38c0af00da59cbd2608e88d9a793297
parent05cac183f59a524fccc7a20deb6ce82bf8c038d1
fix mingw stat() and lstat() implementations for handling symlinks

In msysGit the stat() function has been implemented using mingw_lstat
which sets the st_mode member to S_IFLNK when a symbolic links is found.
This causes the is_executable function to return when git attempts to
build a list of available commands in the help code and we end up missing
most git commands. (msysGit issue #445)

This patch modifies the implementation so that lstat() will return the link
flag but if we are called as stat() we read the size of the target and set
the mode to that of a regular file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
compat/mingw.c
compat/mingw.h