[win32][patch] getftype() returns wrong result for symlink

30 views
Skip to first unread message

Ken Takata

unread,
Jan 18, 2016, 8:49:28 AM1/18/16
to vim_dev
Hi,

When passing a symlink to a directory, getftype() returns "file" on Windows.
I think it should return "dir" as same as a junction. (Returning "link"
might cause trouble, because many people don't care about symlinks on Windows.)
This is caused by a bug of VC runtime which was fixed by VC2015. VC2013 or
earlier and MinGW have this bug. (I don't know about other old compilers
like BCC.)
Attached patch fixes the problem.

Note: Creating a symlink on Windows needs admin rights, so we cannot write
tests for this.

Regards,
Ken Takata

fix-7.4.039-S_IFDIR.patch

Bram Moolenaar

unread,
Jan 19, 2016, 1:00:59 PM1/19/16
to Ken Takata, vim_dev
Thanks, I'll include it.

--
The goal of science is to build better mousetraps.
The goal of nature is to build better mice.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages