Skip to content

Commit 9d57ea5

Browse files
Damienchrisbra
authored andcommitted
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]>
1 parent 4c3616d commit 9d57ea5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

runtime/autoload/netrw.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
" 2024 Jun 04 by Vim Project: set bufhidden if buffer changed, nohidden is set and buffer shall be switched (#14915)
1717
" 2024 Jun 13 by Vim Project: glob() on Windows fails when a directory name contains [] (#14952)
1818
" 2024 Jun 23 by Vim Project: save ad restore registers when liststyle = WIDELIST (#15077, #15114)
19+
" 2024 Jul 22 by Vim Project: avoid endless recursion (#15318)
1920
" Former Maintainer: Charles E Campbell
2021
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
2122
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
@@ -694,12 +695,11 @@ fun! netrw#Explore(indx,dosplit,style,...)
694695
\ ((isdirectory(s:NetrwFile(a:1))))? 'is a directory' : 'is not a directory',
695696
\ '~'.expand("<slnum>"))
696697
if a:1 =~ "\\\s" && !filereadable(s:NetrwFile(a:1)) && !isdirectory(s:NetrwFile(a:1))
697-
" call Decho("re-trying Explore with <".substitute(a:1,'\\\(\s\)','\1','g').">",'~'.expand("<slnum>"))
698-
call netrw#Explore(a:indx,a:dosplit,a:style,substitute(a:1,'\\\(\s\)','\1','g'))
699-
" call Dret("netrw#Explore : returning from retry")
700-
return
701-
" else " Decho
702-
" call Decho("retry not needed",'~'.expand("<slnum>"))
698+
let a1 = substitute(a:1, '\\\(\s\)', '\1', 'g')
699+
if a1 != a:1
700+
call netrw#Explore(a:indx, a:dosplit, a:style, a1)
701+
return
702+
endif
703703
endif
704704
endif
705705

0 commit comments

Comments
 (0)