mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
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)
This commit is contained in:
committed by
Bram Moolenaar
parent
ba26367fea
commit
5a664fe57f
@@ -390,7 +390,7 @@ mch_isFullName(char_u *fname)
|
|||||||
// the same as the name or mch_FullName() fails. However, this has quite a
|
// the same as the name or mch_FullName() fails. However, this has quite a
|
||||||
// bit of overhead, so let's not do that.
|
// bit of overhead, so let's not do that.
|
||||||
if (*fname == NUL)
|
if (*fname == NUL)
|
||||||
return TRUE;
|
return FALSE;
|
||||||
return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':'
|
return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':'
|
||||||
&& (fname[2] == '/' || fname[2] == '\\'))
|
&& (fname[2] == '/' || fname[2] == '\\'))
|
||||||
|| (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
|
|| (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
|
||||||
|
@@ -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'))
|
||||||
call assert_equal('fb2.tar.gz', fnamemodify('abc.fb2.tar.gz', ':e: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('tar', fnamemodify('abc.fb2.tar.gz', ':e:e:r'))
|
||||||
|
call assert_equal(getcwd(), fnamemodify('', ':p:h'))
|
||||||
|
|
||||||
let cwd = getcwd()
|
let cwd = getcwd()
|
||||||
call chdir($HOME)
|
call chdir($HOME)
|
||||||
|
@@ -749,6 +749,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3939,
|
||||||
/**/
|
/**/
|
||||||
3938,
|
3938,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user