Commit 4753711235b817082460c2781749c27ef2d9bc78

Sven Strickroth 2013-06-25T16:46:06

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>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;