char_u *afterdir;
size_t afterlen = 0;
char_u *ffname = fix_fname(fname);
+ int fname_len;
if (ffname == NULL)
return;
* 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);