Correctly handle junctions A junction has S_IFDIR | S_IFLNK set, however, only one makes sense. Signed-off-by: Sven Strickroth <email@cs-ware.de>
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index f049744..036632e 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -90,6 +90,9 @@ static int do_lstat(
if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
fMode |= S_IFLNK;
+ if ((fMode & (S_IFDIR | S_IFLNK)) == (S_IFDIR | S_IFLNK)) // junction
+ fMode ^= S_IFLNK;
+
buf->st_ino = 0;
buf->st_gid = 0;
buf->st_uid = 0;