mirror of
https://github.com/git/git.git
synced 2026-03-14 10:53:25 +01:00
mingw: fix st_mode for symlink dirs
When encountering symlinks, do_lstat() currently overwrites buf->st_mode with S_IFREG if follow is true. This is incorrect when the symlink points to a directory. get_file_attr calls GetFileAttributesExA, which follows symlinks already. So our st_mode should already be correct at this point. Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
This commit is contained in:
committed by
Johannes Schindelin
parent
acc5880a61
commit
c8a1530575
@@ -373,7 +373,6 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
|
||||
if (follow) {
|
||||
char buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
|
||||
buf->st_size = readlink(file_name, buffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE);
|
||||
buf->st_mode = S_IFREG;
|
||||
} else {
|
||||
buf->st_mode = S_IFLNK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user