mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-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 vim/vim#9428, closes vim/vim#9427)
5a664fe57f
This commit is contained in:
parent
bfc11e9c64
commit
72816136a5
@ -2403,7 +2403,7 @@ int path_is_absolute(const char_u *fname)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (*fname == NUL) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
// A name like "d:/foo" and "//server/share" is absolute
|
||||
return ((isalpha(fname[0]) && fname[1] == ':' && vim_ispathsep_nocolon(fname[2]))
|
||||
|
@ -29,6 +29,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)
|
||||
|
Loading…
Reference in New Issue
Block a user