mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.1.0499: MS-Windows: doesn't handle symlinks properly (#29400)
Problem: MS-Windows: doesn't handle symlinks properly
(Timothy Madden)
Solution: Implement lstat() on MS-Windows
(author)
lstat() differs from stat() in how it handles symbolic links, the former
doesn't resolve the symlink while the latter does so.
Implement a simple yet effective fallback using Win32 APIs.
fixes vim/vim#14933
closes: vim/vim#15014
23c5ebeb95
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
This commit is contained in:
parent
6012f79557
commit
a2d510e101
@ -3475,6 +3475,29 @@ func Test_glob2()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_glob_symlinks()
|
||||
call writefile([], 'Xglob1')
|
||||
|
||||
if has("win32")
|
||||
silent !mklink XglobBad DoesNotExist
|
||||
if v:shell_error
|
||||
throw 'Skipped: cannot create symlinks'
|
||||
endif
|
||||
silent !mklink XglobOk Xglob1
|
||||
else
|
||||
silent !ln -s DoesNotExist XglobBad
|
||||
silent !ln -s Xglob1 XglobOk
|
||||
endif
|
||||
|
||||
" The broken symlink is excluded when alllinks is false.
|
||||
call assert_equal(['Xglob1', 'XglobBad', 'XglobOk'], sort(glob('Xglob*', 0, 1, 1)))
|
||||
call assert_equal(['Xglob1', 'XglobOk'], sort(glob('Xglob*', 0, 1, 0)))
|
||||
|
||||
call delete('Xglob1')
|
||||
call delete('XglobBad')
|
||||
call delete('XglobOk')
|
||||
endfunc
|
||||
|
||||
" Test for browse()
|
||||
func Test_browse()
|
||||
CheckFeature browse
|
||||
|
Loading…
Reference in New Issue
Block a user