Patch 8.2.1804
Problem: resolve('/') returns an empty string.
Solution: Don't remove single slash. (closes #7074)
Files: src/filepath.c, src/testdir/test_functions.vim
*** ../vim-8.2.1803/src/filepath.c 2020-09-25 23:48:58.003938752 +0200
--- src/filepath.c 2020-10-05 20:36:51.261287143 +0200
***************
*** 1889,1895 ****
is_relative_to_current = TRUE;
len = STRLEN(p);
! if (len > 0 && after_pathsep(p, p + len))
{
has_trailing_pathsep = TRUE;
p[len - 1] = NUL; // the trailing slash breaks readlink()
--- 1889,1895 ----
is_relative_to_current = TRUE;
len = STRLEN(p);
! if (len > 1 && after_pathsep(p, p + len))
{
has_trailing_pathsep = TRUE;
p[len - 1] = NUL; // the trailing slash breaks readlink()
*** ../vim-8.2.1803/src/testdir/test_functions.vim 2020-09-25
22:42:43.852669232 +0200
--- src/testdir/test_functions.vim 2020-10-05 20:36:05.533395161 +0200
***************
*** 339,344 ****
--- 339,346 ----
call assert_equal('Xlink2', resolve('Xlink1'))
call assert_equal('./Xlink2', resolve('./Xlink1'))
call delete('Xlink1')
+
+ call assert_equal('/', resolve('/'))
endfunc
func s:normalize_fname(fname)
*** ../vim-8.2.1803/src/version.c 2020-10-05 20:07:14.413414315 +0200
--- src/version.c 2020-10-05 20:35:23.609493584 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1804,
/**/
--
Those who live by the sword get shot by those who don't.
/// 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/202010051838.095IcYwF2482870%40masaka.moolenaar.net.