]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0418: wildcards in expanded env vars reinterpreted by glob v9.2.0418
authorglepnir <glephunter@gmail.com>
Wed, 29 Apr 2026 19:10:43 +0000 (19:10 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 29 Apr 2026 19:10:43 +0000 (19:10 +0000)
commit20e98ff1cc3ffc13d42579d2bf9b9567f98595a2
tree75996b7ab3c8f2b429cc8e4a206abbf3053e3458
parentaf494af5ff188d976073cbc049249614edffa4bf
patch 9.2.0418: wildcards in expanded env vars reinterpreted by glob

Problem:  With $d='[dir]', `:e $d/file.txt` opens the wrong file,
          `:e $d/<Tab>` fails to complete, and `glob('$d/*')` returns
          nothing. Wildcard characters inside expanded environment
          variables get picked up by globbing again.
Solution: Turn the 4th parameter of expand_env_esc() from a bool into a
          string of characters to escape in each expanded value. Callers
          that pass the result to wildcard expansion should include
          PATH_ESC_WILDCARDS in addition to " \t" (glepnir).

closes: #20053

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
12 files changed:
runtime/doc/todo.txt
src/cmdexpand.c
src/ex_docmd.c
src/filepath.c
src/findfile.c
src/misc1.c
src/option.c
src/profiler.c
src/proto/misc1.pro
src/testdir/test_cmdline.vim
src/version.c
src/vim.h