changeset 27150:2d0ea3f9ffe1 v8.2.4104

patch 8.2.4104: Vim9: lower casing the autoload prefix causes problems Commit: https://github.com/vim/vim/commit/bfac409d0b24d212a6d846edb651c49dac03745f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 16 11:12:12 2022 +0000 patch 8.2.4104: Vim9: lower casing the autoload prefix causes problems Problem: Vim9: lower casing the autoload prefix causes problems. Solution: Always store the prefix with case preserved.
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Jan 2022 12:15:04 +0100
parents 5ec89814c0bf
children 7bb327c29de3
files src/scriptfile.c src/testdir/test_vim9_import.vim src/version.c
diffstat 3 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -2156,11 +2156,7 @@ get_autoload_prefix(scriptitem_T *si)
 
     if (p == NULL)
 	return NULL;
-#ifdef CASE_INSENSITIVE_FILENAME
-    prefix = strlow_save(p);
-#else
     prefix = vim_strsave(p);
-#endif
     if (prefix == NULL)
 	return NULL;
 
--- a/src/testdir/test_vim9_import.vim
+++ b/src/testdir/test_vim9_import.vim
@@ -1485,6 +1485,15 @@ def Test_vim9_autoload_case_sensitive()
   END
   CheckScriptSuccess(lines)
 
+  if !has('fname_case')
+    lines =<< trim END
+        vim9script
+        import autoload 'CaseSensitive.vim'
+        import autoload 'casesensitive.vim'
+    END
+    CheckScriptFailure(lines, 'E1262:')
+  endif
+
   delete('Xdir', 'rf')
   &rtp = save_rtp
 enddef
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4104,
+/**/
     4103,
 /**/
     4102,