aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-04-19 14:11:01 +0200
committerGitHub <noreply@github.com>2020-04-19 14:11:01 +0200
commitca02db1f9fac9fd91164af2c9e42e57913f08f9a (patch)
treee55c05daaf1177cc5d4f713217562d4f4ace15a8 /src/nvim/eval/funcs.c
parentbf0f74586153dfa8d550e1cfefd83ca9e0354171 (diff)
parentb687a6c2b2c096a68b46141947aef29c616f7a1f (diff)
downloadrneovim-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.c7
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