diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-04-19 14:11:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 14:11:01 +0200 |
commit | ca02db1f9fac9fd91164af2c9e42e57913f08f9a (patch) | |
tree | e55c05daaf1177cc5d4f713217562d4f4ace15a8 /src/nvim/eval/funcs.c | |
parent | bf0f74586153dfa8d550e1cfefd83ca9e0354171 (diff) | |
parent | b687a6c2b2c096a68b46141947aef29c616f7a1f (diff) | |
download | rneovim-ca02db1f9fac9fd91164af2c9e42e57913f08f9a.tar.gz rneovim-ca02db1f9fac9fd91164af2c9e42e57913f08f9a.tar.bz2 rneovim-ca02db1f9fac9fd91164af2c9e42e57913f08f9a.zip |
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.
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 21a6904674..2dfc46023a 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -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 |