runtime(netrw): Fix endless recursion in netrw#Explore()
Commit:
https://github.com/vim/vim/commit/9d57ea5cd3a23af02c72c0e86fe24b7bba57189a
Author: Damien <[email protected]>
Date: Mon Jul 22 20:23:48 2024 +0200
runtime(netrw): Fix endless recursion in netrw#Explore()
Problem: ':E /etc BOOM' give E132 error.
Solution: Avoid recursion call with same arguments.
fixes: #5723
closes: #15318
Signed-off-by: Damien <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 7b7081b0c..5c2a43a17 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -16,6 +16,7 @@
" 2024 Jun 04 by Vim Project: set bufhidden if buffer changed, nohidden is
set and buffer shall be switched (#14915)
" 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)
" Former Maintainer: Charles E Campbell
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
@@ -694,12 +695,11 @@ fun! netrw#Explore(indx,dosplit,style,...)
\ ((isdirectory(s:NetrwFile(a:1))))? 'is a directory' : 'is
not a directory',
\ '~'.expand("<slnum>"))
if a:1 =~ "\\s" && !filereadable(s:NetrwFile(a:1)) &&
!isdirectory(s:NetrwFile(a:1))
-" call Decho("re-trying Explore with <".substitute(a:1,'\\(\s\)','
','g').">",'~'.expand("<slnum>"))
- call netrw#Explore(a:indx,a:dosplit,a:style,substitute(a:1,'\\(\s\)','
','g'))
-" call Dret("netrw#Explore : returning from retry")
- return
-" else " Decho
-" call Decho("retry not needed",'~'.expand("<slnum>"))
+ let a1 = substitute(a:1, '\\(\s\)', ' ', 'g')
+ if a1 != a:1
+ call netrw#Explore(a:indx, a:dosplit, a:style, a1)
+ return
+ endif
endif
endif
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1sVxnW-003ocs-GX%40256bit.org.