From c8a1530575b76c6e444c683ef77b40fa005c6942 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Sat, 20 Mar 2010 22:48:42 +0100 Subject: [PATCH] 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 Signed-off-by: Erik Faye-Lund --- compat/mingw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/compat/mingw.c b/compat/mingw.c index bbae2be946..7ec615c5ac 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -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; } -- 2.11.4.GIT