mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
Merge pull request #12047 from erw7/fix-resolve-on-windows
Change resolve() to resolve symbolic links on Windows Neovim worked the same way as vim for shortcuts, but didn't handle symbolic links and junction cases. This PR implements the same behavior for symbolic links and junctions as for vim.
This commit is contained in:
@@ -6722,7 +6722,12 @@ static void f_resolve(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
rettv->v_type = VAR_STRING;
|
||||
const char *fname = tv_get_string(&argvars[0]);
|
||||
#ifdef WIN32
|
||||
char *const v = os_resolve_shortcut(fname);
|
||||
char *v = os_resolve_shortcut(fname);
|
||||
if (v == NULL) {
|
||||
if (os_is_reparse_point_include(fname)) {
|
||||
v = os_realpath(fname, v);
|
||||
}
|
||||
}
|
||||
rettv->vval.v_string = (char_u *)(v == NULL ? xstrdup(fname) : v);
|
||||
#else
|
||||
# ifdef HAVE_READLINK
|
||||
|
Reference in New Issue
Block a user