# HG changeset patch # User Bram Moolenaar # Date 1612703704 -3600 # Node ID 7d3ee4d508b5dff1859a867dbc9a6bffed7187dd # Parent e48a201d9411364462fea9ab3135739e4021bf8f patch 8.2.2478: MS-Windows: backup files for plugins are loaded Commit: https://github.com/vim/vim/commit/0dc5f603e9b86da9fe5798c231d8d6170501516e Author: Bram Moolenaar Date: Sun Feb 7 14:01:35 2021 +0100 patch 8.2.2478: MS-Windows: backup files for plugins are loaded Problem: MS-Windows: backup files for plugins are loaded. Solution: Do not use the alternate file name for files ending in "~". diff --git a/src/filepath.c b/src/filepath.c --- 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 --- 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,