Mercurial > vim
changeset 23873:7d3ee4d508b5 v8.2.2478
patch 8.2.2478: MS-Windows: backup files for plugins are loaded
Commit: https://github.com/vim/vim/commit/0dc5f603e9b86da9fe5798c231d8d6170501516e
Author: Bram Moolenaar <Bram@vim.org>
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 "~".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Feb 2021 14:15:04 +0100 |
parents | e48a201d9411 |
children | 4aff5ea80b69 |
files | src/filepath.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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);