mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.1417: MS-Windows: resolve() does not resolve all components of path
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)
This commit is contained in:
@@ -1787,12 +1787,6 @@ resolve_reparse_point(char_u *fname)
|
|||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if ((GetFileAttributesW(p) & FILE_ATTRIBUTE_REPARSE_POINT) == 0)
|
|
||||||
{
|
|
||||||
vim_free(p);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
h = CreateFileW(p, 0, 0, NULL, OPEN_EXISTING,
|
h = CreateFileW(p, 0, 0, NULL, OPEN_EXISTING,
|
||||||
FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||||
vim_free(p);
|
vim_free(p);
|
||||||
|
@@ -238,7 +238,7 @@ endfunc
|
|||||||
func s:normalize_fname(fname)
|
func s:normalize_fname(fname)
|
||||||
let ret = substitute(a:fname, '\', '/', 'g')
|
let ret = substitute(a:fname, '\', '/', 'g')
|
||||||
let ret = substitute(ret, '//', '/', 'g')
|
let ret = substitute(ret, '//', '/', 'g')
|
||||||
let ret = tolower(ret)
|
return tolower(ret)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_resolve_win32()
|
func Test_resolve_win32()
|
||||||
@@ -330,6 +330,19 @@ func Test_resolve_win32()
|
|||||||
echomsg 'skipped test for buffer name'
|
echomsg 'skipped test for buffer name'
|
||||||
endif
|
endif
|
||||||
call delete('Xfile')
|
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
|
endfunc
|
||||||
|
|
||||||
func Test_simplify()
|
func Test_simplify()
|
||||||
|
@@ -767,6 +767,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1417,
|
||||||
/**/
|
/**/
|
||||||
1416,
|
1416,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user