Problem: Wrong file name shortening. (Ingo Karkat)
Solution: Better check for path separator. (Yasuhiro Matsumoto,
closes #5583, closes #5584)
if (fnamencmp(p, dirname, namelen) == 0)
{
p += namelen;
- while (*p && vim_ispathsep(*p))
- ++p;
- *fnamep = p;
- if (pbuf != NULL)
+ if (vim_ispathsep(*p))
{
- vim_free(*bufp); // free any allocated file name
- *bufp = pbuf;
- pbuf = NULL;
+ while (*p && vim_ispathsep(*p))
+ ++p;
+ *fnamep = p;
+ if (pbuf != NULL)
+ {
+ // free any allocated file name
+ vim_free(*bufp);
+ *bufp = pbuf;
+ pbuf = NULL;
+ }
}
}
}
call chdir($HOME . '/XXXXXXXX/a/')
call assert_equal('foo', fnamemodify($HOME . '/XXXXXXXX/a/foo', ':p:~:.'))
call assert_equal('~/XXXXXXXX/b/foo', fnamemodify($HOME . '/XXXXXXXX/b/foo', ':p:~:.'))
+ call mkdir($HOME . '/XXXXXXXX/a.ext', 'p')
+ call assert_equal('~/XXXXXXXX/a.ext/foo', fnamemodify($HOME . '/XXXXXXXX/a.ext/foo', ':p:~:.'))
call chdir(cwd)
call delete($HOME . '/XXXXXXXX', 'rf')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 215,
/**/
214,
/**/