diff options
author | Nikita Rudakov <53019776+zer0reaction@users.noreply.github.com> | 2024-07-24 02:33:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-24 07:33:44 +0800 |
commit | c025c049a4a7b0a6dbcd94f804504bba6d081a84 (patch) | |
tree | 526a1ce6e149f4d0cf1154ce743349ce5c350f03 | |
parent | 9793a97778dbb8b023272553dba6da87ae210ad3 (diff) | |
download | rneovim-c025c049a4a7b0a6dbcd94f804504bba6d081a84.tar.gz rneovim-c025c049a4a7b0a6dbcd94f804504bba6d081a84.tar.bz2 rneovim-c025c049a4a7b0a6dbcd94f804504bba6d081a84.zip |
vim-patch:581d4a7: runtime(netrw): escape filename before trying to delete it (#29838)
fixes: vim/vim#15330
https://github.com/vim/vim/commit/581d4a7b356395bcb8606c1717ded65d47d26c68
Co-authored-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | runtime/autoload/netrw.vim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index b4d7743236..92d8409440 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -17,6 +17,7 @@ " 2024 Jun 13 by Vim Project: glob() on Windows fails when a directory name contains [] (#14952) " 2024 Jun 23 by Vim Project: save ad restore registers when liststyle = WIDELIST (#15077, #15114) " 2024 Jul 22 by Vim Project: avoid endless recursion (#15318) +" 2024 Jul 23 by Vim Project: escape filename before trying to delete it (#15330) " Former Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 @@ -11342,7 +11343,7 @@ fun! s:NetrwLocalRmFile(path,fname,all) let all= a:all let ok = "" NetrwKeepj norm! 0 - let rmfile= s:NetrwFile(s:ComposePath(a:path,a:fname)) + let rmfile= s:NetrwFile(s:ComposePath(a:path,escape(a:fname, '\\'))) " call Decho("rmfile<".rmfile.">",'~'.expand("<slnum>")) if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$') @@ -11351,7 +11352,7 @@ fun! s:NetrwLocalRmFile(path,fname,all) if !all echohl Statement call inputsave() - let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") + let ok= input("Confirm deletion of file <".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") call inputrestore() echohl NONE if ok == "" @@ -11375,7 +11376,7 @@ fun! s:NetrwLocalRmFile(path,fname,all) if !all echohl Statement call inputsave() - let ok= input("Confirm *recursive* deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") + let ok= input("Confirm *recursive* deletion of directory <".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") call inputrestore() let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') if ok == "" |