Problem: On MS-Windows a pattern like "path/*.vim" also matches files such
as "foo.vim9", because the 8.3 short name "FOO~1.VIM" is used for
matching as well. These files are then sourced.
Solution: Only match against the short name when the pattern contains a '~'.
This was in todo.txt, the entry is removed.
On MS-Windows, with a directory containing "bar.vim", "foo.vim9" and
"foo.vimx" on a volume where 8.3 short names are created:
glob('plugin/*.vim') -> bar.vim, foo.vim9, foo.vimx
:runtime! plugin/*.vim -> all three are sourced
The short name of "foo.vim9" is "FOO~1.VIM", which matches "*.vim", and
dos_expandpath() matches the pattern against both the long and the short
name. The only guard was for names ending in '~'.
With this change the short name is only used when the pattern contains a
'~', which is how the function already recognizes a short name, see the
comment about "a wildcard or a ~1" at the top. Both now find only
"bar.vim", while a pattern that is a short name still matches:
glob('FOO~1.VIM') -> foo.vim9
The test skips when the volume does not create short names, checked with
":p:8".
https://github.com/vim/vim/pull/20899
(3 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()