aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-08-21 12:10:15 -0400
committerJames McCoy <jamessan@jamessan.com>2017-08-21 20:29:48 -0400
commita66eca78c2082aca112125f759be2ef3aa7ef832 (patch)
tree2953614b0608cf4a6c6ae531cf5f2081b09bd9c7 /src
parent9ff0cc70855fc3eb11ad0162ee02e742f354d360 (diff)
downloadrneovim-a66eca78c2082aca112125f759be2ef3aa7ef832.tar.gz
rneovim-a66eca78c2082aca112125f759be2ef3aa7ef832.tar.bz2
rneovim-a66eca78c2082aca112125f759be2ef3aa7ef832.zip
vim-patch:8.0.0308
Problem: When using a symbolic link, the package path will not be inserted at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi) Solution: Resolve symbolic links when finding the right position in 'runtimepath'. (Hirohito Higashi) https://github.com/vim/vim/commit/2f9e575583c2ad3978ee3d0f790eeff7df56bd6c
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds2.c28
-rw-r--r--src/nvim/version.c2
2 files changed, 18 insertions, 12 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 33fe30cd5a..f8c470f213 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -2498,6 +2498,7 @@ static int APP_BOTH;
static void add_pack_plugin(char_u *fname, void *cookie)
{
char_u *p4, *p3, *p2, *p1, *p;
+ char_u *buf = NULL;
char *const ffname = fix_fname((char *)fname);
@@ -2525,26 +2526,30 @@ static void add_pack_plugin(char_u *fname, void *cookie)
// Find "ffname" in "p_rtp", ignoring '/' vs '\' differences
size_t fname_len = strlen(ffname);
const char *insp = (const char *)p_rtp;
- for (;;) {
- if (path_fnamencmp(insp, ffname, fname_len) == 0) {
- break;
+ buf = try_malloc(MAXPATHL);
+ if (buf == NULL) {
+ goto theend;
+ }
+ while (*insp != NUL) {
+ copy_option_part((char_u **)&insp, buf, MAXPATHL, ",");
+ add_pathsep((char *)buf);
+ char *const rtp_ffname = fix_fname((char *)buf);
+ if (rtp_ffname == NULL) {
+ goto theend;
}
- insp = strchr(insp, ',');
- if (insp == NULL) {
+ bool match = path_fnamencmp(rtp_ffname, ffname, fname_len) == 0;
+ xfree(rtp_ffname);
+ if (match) {
break;
}
- insp++;
}
- if (insp == NULL) {
+ if (*insp == NUL) {
// not found, append at the end
insp = (const char *)p_rtp + STRLEN(p_rtp);
} else {
// append after the matching directory.
- insp += strlen(ffname);
- while (*insp != NUL && *insp != ',') {
- insp++;
- }
+ insp--;
}
*p4 = c;
@@ -2614,6 +2619,7 @@ static void add_pack_plugin(char_u *fname, void *cookie)
}
theend:
+ xfree(buf);
xfree(ffname);
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 2a3fdbd70d..a190293d8e 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -644,7 +644,7 @@ static const int included_patches[] = {
311,
// 310,
// 309,
- // 308,
+ 308,
307,
// 306,
// 305,