# HG changeset patch # User Bram Moolenaar # Date 1640802603 -3600 # Node ID 81f0d5a958b9b7c2c2500646664f7be44863ee9c # Parent 6a6a985ee1d57be21d2aa67b0c7c9cbfeec8e96b patch 8.2.3939: MS-Windows: fnamemodify('', ':p') does not work Commit: https://github.com/vim/vim/commit/5a664fe57fe7ba65a771bc95ef1c205e4db193b7 Author: Yegappan Lakshmanan Date: Wed Dec 29 18:16:21 2021 +0000 patch 8.2.3939: MS-Windows: fnamemodify('', ':p') does not work Problem: MS-Windows: fnamemodify('', ':p') does not work. Solution: Do not consider an empty string a full path. (Yegappan Lakshmanan, closes #9428, closes #9427) diff --git a/src/os_mswin.c b/src/os_mswin.c --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -390,7 +390,7 @@ mch_isFullName(char_u *fname) // 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 FALSE; return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\')) || (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\'))); diff --git a/src/testdir/test_fnamemodify.vim b/src/testdir/test_fnamemodify.vim --- a/src/testdir/test_fnamemodify.vim +++ b/src/testdir/test_fnamemodify.vim @@ -32,6 +32,7 @@ func Test_fnamemodify() 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) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3939, +/**/ 3938, /**/ 3937,