mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.0215: wrong file name shortening
Problem: Wrong file name shortening. (Ingo Karkat) Solution: Better check for path separator. (Yasuhiro Matsumoto, closes #5583, closes #5584)
This commit is contained in:
@@ -448,14 +448,18 @@ repeat:
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user