Patch 8.2.0215 (after 8.2.0208)
Problem: Wrong file name shortening. (Ingo Karkat)
Solution: Better check for path separator. (Yasuhiro Matsumoto,
closes #5583, closes #5584)
Files: src/filepath.c, src/testdir/test_fnamemodify.vim
*** ../vim-8.2.0214/src/filepath.c 2020-02-04 22:32:56.310097798 +0100
--- src/filepath.c 2020-02-05 21:09:48.362110931 +0100
***************
*** 448,461 ****
if (fnamencmp(p, dirname, namelen) == 0)
{
p += namelen;
! while (*p && vim_ispathsep(*p))
! ++p;
! *fnamep = p;
! if (pbuf != NULL)
{
! vim_free(*bufp); // free any allocated file name
! *bufp = pbuf;
! pbuf = NULL;
}
}
}
--- 448,465 ----
if (fnamencmp(p, dirname, namelen) == 0)
{
p += namelen;
! if (vim_ispathsep(*p))
{
! while (*p && vim_ispathsep(*p))
! ++p;
! *fnamep = p;
! if (pbuf != NULL)
! {
! // free any allocated file name
! vim_free(*bufp);
! *bufp = pbuf;
! pbuf = NULL;
! }
}
}
}
*** ../vim-8.2.0214/src/testdir/test_fnamemodify.vim 2020-02-04
22:22:43.060586069 +0100
--- src/testdir/test_fnamemodify.vim 2020-02-05 21:09:48.362110931 +0100
***************
*** 36,41 ****
--- 36,43 ----
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')
*** ../vim-8.2.0214/src/version.c 2020-02-05 21:07:00.110961395 +0100
--- src/version.c 2020-02-05 21:13:43.824940158 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 215,
/**/
--
hundred-and-one symptoms of being an internet addict:
32. You don't know what sex three of your closest friends are, because they
have neutral nicknames and you never bothered to ask.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202002052015.015KF7Yu006245%40masaka.moolenaar.net.