Patch 8.2.3939
Problem: MS-Windows: fnamemodify('', ':p') does not work.
Solution: Do not consider an empty string a full path. (Yegappan Lakshmanan,
closes #9428, closes #9427)
Files: src/os_mswin.c, src/testdir/test_fnamemodify.vim
*** ../vim-8.2.3938/src/os_mswin.c 2021-12-27 17:21:38.016449116 +0000
--- src/os_mswin.c 2021-12-29 18:12:06.534178661 +0000
***************
*** 390,396 ****
// the same as the name or mch_FullName() fails. However, this has quite
a
// bit of overhead, so let's not do that.
if (*fname == NUL)
! return TRUE;
return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':'
&& (fname[2] == '/' || fname[2] == '\\'))
|| (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
--- 390,396 ----
// the same as the name or mch_FullName() fails. However, this has quite
a
// bit of overhead, so let's not do that.
if (*fname == NUL)
! return FALSE;
return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':'
&& (fname[2] == '/' || fname[2] == '\\'))
|| (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
*** ../vim-8.2.3938/src/testdir/test_fnamemodify.vim 2021-12-16
13:06:06.958019734 +0000
--- src/testdir/test_fnamemodify.vim 2021-12-29 18:12:06.538178656 +0000
***************
*** 32,37 ****
--- 32,38 ----
call assert_equal('fb2.tar.gz', fnamemodify('abc.fb2.tar.gz', ':e:e:e'))
call assert_equal('fb2.tar.gz', fnamemodify('abc.fb2.tar.gz', ':e:e:e:e'))
call assert_equal('tar', fnamemodify('abc.fb2.tar.gz', ':e:e:r'))
+ call assert_equal(getcwd(), fnamemodify('', ':p:h'))
let cwd = getcwd()
call chdir($HOME)
*** ../vim-8.2.3938/src/version.c 2021-12-29 18:09:10.242453334 +0000
--- src/version.c 2021-12-29 18:14:14.009983123 +0000
***************
*** 751,752 ****
--- 751,754 ----
{ /* Add new patch number below this line */
+ /**/
+ 3939,
/**/
--
hundred-and-one symptoms of being an internet addict:
144. You eagerly await the update of the "Cool Site of the Day."
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ 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/20211229181700.3B4EA1C0641%40moolenaar.net.