diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-29 20:36:54 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-29 20:36:54 +0200 |
commit | 1bbebab5255b5300d727c9b3f1b308205847dafd (patch) | |
tree | 85f92b69fb8970b5d389259efcb22b1b38fea074 | |
parent | bc133543b8b0ebb1d8624e37d840b739eb00f3f3 (diff) | |
download | vim-git-1bbebab5255b5300d727c9b3f1b308205847dafd.tar.gz |
patch 8.1.1417: MS-Windows: resolve() does not resolve all components of pathv8.1.1417
Problem: MS-Windows: resolve() does not resolve all components of the path.
(David Briscoe)
Solution: Do not bail out for a reparse point. (Yasuhiro Matsumoto,
closes #4211, closes #4447)
-rw-r--r-- | src/os_mswin.c | 6 | ||||
-rw-r--r-- | src/testdir/test_functions.vim | 15 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c index 869c9a002..2b878f77c 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -1787,12 +1787,6 @@ resolve_reparse_point(char_u *fname) if (p == NULL) goto fail; - if ((GetFileAttributesW(p) & FILE_ATTRIBUTE_REPARSE_POINT) == 0) - { - vim_free(p); - goto fail; - } - h = CreateFileW(p, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); vim_free(p); diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 3e4c03cdb..cc1ee8b61 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -238,7 +238,7 @@ endfunc func s:normalize_fname(fname) let ret = substitute(a:fname, '\', '/', 'g') let ret = substitute(ret, '//', '/', 'g') - let ret = tolower(ret) + return tolower(ret) endfunc func Test_resolve_win32() @@ -330,6 +330,19 @@ func Test_resolve_win32() echomsg 'skipped test for buffer name' endif call delete('Xfile') + + " test for reparse point + call mkdir('Xdir') + silent !mklink /D Xdirlink Xdir + if !v:shell_error + w Xdir/text.txt + call assert_equal(s:normalize_fname(getcwd() . '\Xdir\text.txt'), s:normalize_fname(resolve('Xdirlink\text.txt'))) + call assert_equal(s:normalize_fname(getcwd() . '\Xdir'), s:normalize_fname(resolve('Xdirlink'))) + else + echomsg 'skipped test for reparse point' + endif + + call delete('Xdir', 'rf') endfunc func Test_simplify() diff --git a/src/version.c b/src/version.c index b03234702..38b51f79e 100644 --- a/src/version.c +++ b/src/version.c @@ -768,6 +768,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1417, +/**/ 1416, /**/ 1415, |