]> granicus.if.org Git - vim/commitdiff
patch 7.4.1973 v7.4.1973
authorBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 13:39:40 +0000 (15:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 13:39:40 +0000 (15:39 +0200)
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.

src/ex_cmds2.c
src/version.c

index e6ef3811455ee334c1620b4bb5ff84329e6e79ea..e255a13d71fa383c70aba8d03fe05753f8114f39 100644 (file)
@@ -3349,6 +3349,7 @@ add_pack_plugin(char_u *fname, void *cookie)
     char_u  *afterdir;
     size_t  afterlen = 0;
     char_u  *ffname = fix_fname(fname);
+    int            fname_len;
 
     if (ffname == NULL)
        return;
@@ -3369,7 +3370,20 @@ add_pack_plugin(char_u *fname, void *cookie)
         * find the part up to "pack" in 'runtimepath' */
        c = *p4;
        *p4 = NUL;
-       insp = (char_u *)strstr((char *)p_rtp, (char *)ffname);
+
+       /* Find "ffname" in "p_rtp", ignoring '/' vs '\' differences. */
+       fname_len = STRLEN(ffname);
+       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);
index 2c6d8c4a6536880a06d5bab7a00de440612134c7..1e8e63565f22eba09eaa1e077b50bc88fd273b95 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1973,
 /**/
     1972,
 /**/