0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

runtime(netrw): expand $COMSPEC without applying 'wildignore' (#13542)

When expanding $COMSPEC and a user has set :set wildignore=*.exe
netrw won't be able to properly cmd.exe, because it does not ignore the
wildignore setting.

So let's explicitly use expand() without applying the 'wildignore' and
'suffixes' settings to the result

closes: #13426

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt 2023-11-21 18:48:16 +00:00 committed by GitHub
parent 69866449dd
commit cb0c113ddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,9 @@
" netrw.vim: Handles file transfer and remote directory listing across " netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION " AUTOLOAD SECTION
" Date: May 03, 2023 " Date: May 03, 2023
" Version: 173 " Version: 173a
" Last Change:
" 2023 Nov 21 by Vim Project: ignore wildignore when expanding $COMSPEC (v173a)
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
@ -400,7 +402,7 @@ if !exists("g:netrw_localcopycmd")
if g:netrw_cygwin if g:netrw_cygwin
let g:netrw_localcopycmd= "cp" let g:netrw_localcopycmd= "cp"
else else
let g:netrw_localcopycmd = expand("$COMSPEC") let g:netrw_localcopycmd = expand("$COMSPEC", v:true)
let g:netrw_localcopycmdopt= " /c copy" let g:netrw_localcopycmdopt= " /c copy"
endif endif
elseif has("unix") || has("macunix") elseif has("unix") || has("macunix")
@ -415,7 +417,7 @@ if !exists("g:netrw_localcopydircmd")
let g:netrw_localcopydircmd = "cp" let g:netrw_localcopydircmd = "cp"
let g:netrw_localcopydircmdopt= " -R" let g:netrw_localcopydircmdopt= " -R"
else else
let g:netrw_localcopydircmd = expand("$COMSPEC") let g:netrw_localcopydircmd = expand("$COMSPEC", v:true)
let g:netrw_localcopydircmdopt= " /c xcopy /e /c /h /i /k" let g:netrw_localcopydircmdopt= " /c xcopy /e /c /h /i /k"
endif endif
elseif has("unix") elseif has("unix")
@ -436,7 +438,7 @@ if has("win32") || has("win95") || has("win64") || has("win16")
if g:netrw_cygwin if g:netrw_cygwin
call s:NetrwInit("g:netrw_localmkdir","mkdir") call s:NetrwInit("g:netrw_localmkdir","mkdir")
else else
let g:netrw_localmkdir = expand("$COMSPEC") let g:netrw_localmkdir = expand("$COMSPEC", v:true)
let g:netrw_localmkdiropt= " /c mkdir" let g:netrw_localmkdiropt= " /c mkdir"
endif endif
else else
@ -452,7 +454,7 @@ if !exists("g:netrw_localmovecmd")
if g:netrw_cygwin if g:netrw_cygwin
let g:netrw_localmovecmd= "mv" let g:netrw_localmovecmd= "mv"
else else
let g:netrw_localmovecmd = expand("$COMSPEC") let g:netrw_localmovecmd = expand("$COMSPEC", v:true)
let g:netrw_localmovecmdopt= " /c move" let g:netrw_localmovecmdopt= " /c move"
endif endif
elseif has("unix") || has("macunix") elseif has("unix") || has("macunix")