]> granicus.if.org Git - vim/commitdiff
patch 8.2.3939: MS-Windows: fnamemodify('', ':p') does not work v8.2.3939
authorYegappan Lakshmanan <yegappan@yahoo.com>
Wed, 29 Dec 2021 18:16:21 +0000 (18:16 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 29 Dec 2021 18:16:21 +0000 (18:16 +0000)
Problem:    MS-Windows: fnamemodify('', ':p') does not work.
Solution:   Do not consider an empty string a full path. (Yegappan Lakshmanan,
            closes #9428, closes #9427)

src/os_mswin.c
src/testdir/test_fnamemodify.vim
src/version.c

index 26042b498440a5ec1fa36edbb7ed660036f248f7..e27f38908fdc7f931690d514cef01e3a019f3b11 100644 (file)
@@ -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] == '\\')));
index dfe322afd19e1245c5f7412463348d9013daccb3..c19f4646b37f017904c1433ec595dac57c4f390d 100644 (file)
@@ -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)
index 15df8606f76a4f460759c58ac044408f51aa50b1..0f0414e92ddb10689d9006815b87c18bf8a7bea9 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3939,
 /**/
     3938,
 /**/