]> granicus.if.org Git - vim/commitdiff
patch 8.2.4134: MS-Windows: test for import with absolute path fails v8.2.4134
authorBram Moolenaar <Bram@vim.org>
Tue, 18 Jan 2022 13:43:58 +0000 (13:43 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 18 Jan 2022 13:43:58 +0000 (13:43 +0000)
Problem:    MS-Windows: test for import with absolute path fails.
Solution:   Handle path starting with slash as an absolute path.

src/version.c
src/vim9script.c

index 1e9ab2dd964ce4687816bf0d28ca1cae4afc1fd6..8ac5c086708d22f396abf9ca5d1045e1e78a7551 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4134,
 /**/
     4133,
 /**/
index 41df6bfc470ac5f32f792c03737b3ff8f5e45514..b35634786804b787c656d1e5497f941f24d1d71b 100644 (file)
@@ -468,7 +468,13 @@ handle_import(
            vim_free(from_name);
        }
     }
-    else if (mch_isFullName(tv.vval.v_string))
+    else if (mch_isFullName(tv.vval.v_string)
+#ifdef BACKSLASH_IN_FILENAME
+           // On MS-Windows omitting the drive is still handled like an
+           // absolute path, not using 'runtimepath'.
+           || *tv.vval.v_string == '/' || *tv.vval.v_string == '\\'
+#endif
+           )
     {
        // Absolute path: "/tmp/name.vim"
        if (is_autoload)