summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-02-07 14:01:35 +0100
committerBram Moolenaar <Bram@vim.org>2021-02-07 14:01:35 +0100
commit0dc5f603e9b86da9fe5798c231d8d6170501516e (patch)
tree2ff7a0a63eabcf44e7f4c4ea3b580e77745d8069
parentdd07c02232e91ee963b91a4477179d4b9548b862 (diff)
downloadvim-git-8.2.2478.tar.gz
patch 8.2.2478: MS-Windows: backup files for plugins are loadedv8.2.2478
Problem: MS-Windows: backup files for plugins are loaded. Solution: Do not use the alternate file name for files ending in "~".
-rw-r--r--src/filepath.c5
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 81fe74924..8e54e5bcf 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -3360,7 +3360,10 @@ dos_expandpath(
if (p == NULL)
break; // out of memory
- if (*wfb.cAlternateFileName == NUL)
+ // Do not use the alternate filename when the file name ends in '~',
+ // because it picks up backup files: short name for "foo.vim~" is
+ // "foo~1.vim", which matches "*.vim".
+ if (*wfb.cAlternateFileName == NUL || p[STRLEN(p) - 1] == '~')
p_alt = NULL;
else
p_alt = utf16_to_enc(wfb.cAlternateFileName, NULL);
diff --git a/src/version.c b/src/version.c
index 7a91c9bae..ae61a32c8 100644
--- 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 */
/**/
+ 2478,
+/**/
2477,
/**/
2476,