MinGW: fix stat() and lstat() implementations for handling symlinks
commit9d9272d0a754f1d698da0e0cb2992abe44ebfd69
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 17 Mar 2010 15:17:34 +0000 (17 15:17 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Sun, 24 Oct 2010 23:04:04 +0000 (25 00:04 +0100)
tree427ab4b36568ec86867157d13cc99d90279df4d8
parent785039ba99527548ea17430fb1ebfbf9a9d41b33
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