Patch 8.2.3939

5 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 29, 2021, 1:17:03 PM12/29/21
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages