MinGW: fix stat() and lstat() implementations for handling symlinks
commit46fcbec32718cab4e0ef2b1a116c02d2834b576f
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 17 Mar 2010 15:17:34 +0000 (17 15:17 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Fri, 1 Oct 2010 22:21:27 +0000 (1 23:21 +0100)
tree6db5bb815cb405550ce9653f3244b6ba17e46e9e
parent21ed8a9000491d0d7d1249ec0f3c20a0e6585378
MinGW: fix 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.

Includes squashed fix st_mode for symlink dirs

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
compat/mingw.c
compat/mingw.h