From c147766389a11df0bc6cf86bb1a6bd0e22a6026b Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 8 Jul 2016 00:27:05 -0400 Subject: [PATCH] vim-patch:7.4.1973 Problem: On MS-Windows the package directory may be added at the end because of forward/backward slash differences. (Matthew Desjardins) Solution: Ignore slash differences. https://github.com/vim/vim/commit/4c5717ed8a81f5ae9dfe4f38b17a61fc8421054b --- src/nvim/ex_cmds2.c | 16 +++++++++++++++- src/nvim/version.c | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 56f0ca0904..bf75e635b5 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2483,7 +2483,21 @@ static void add_pack_plugin(char_u *fname, void *cookie) // find the part up to "pack" in 'runtimepath' char_u c = *p4; *p4 = NUL; - char_u *insp = (char_u *)strstr((char *)p_rtp, (char *)ffname); + + // Find "ffname" in "p_rtp", ignoring '/' vs '\' differences + int fname_len = STRLEN(ffname); + char_u *insp = p_rtp; + for (;;) { + if (vim_fnamencmp(insp, ffname, fname_len) == 0) { + break; + } + insp = vim_strchr(insp, ','); + if (insp == NULL) { + break; + } + insp++; + } + if (insp == NULL) { // not found, append at the end insp = p_rtp + STRLEN(p_rtp); diff --git a/src/nvim/version.c b/src/nvim/version.c index 358b2cc2f0..8aa3071395 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -75,6 +75,7 @@ static char *features[] = { // clang-format off static int included_patches[] = { + 1973, 1960, 1840, 1832,