mirror of
https://github.com/vim/vim.git
synced 2025-11-13 22:54:27 -05:00
patch 9.1.1875: username parsing bug in netrw plugin
Problem: username parsing bug in netrw plugin when using remote adding
feature
Solution: Allow any characters except for "@" (Václav Kobera), add a
test for the netrw plugin
closes: #18611
Signed-off-by: Václav Kobera <vasekobera@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
f0e11d3279
commit
f17f78c557
@@ -10,6 +10,7 @@
|
||||
" 2025 Sep 17 by Vim Project tighten the regex to handle remote compressed archives #18318
|
||||
" 2025 Sep 18 by Vim Project 'equalalways' not always respected #18358
|
||||
" 2025 Oct 01 by Vim Project fix navigate to parent folder #18464
|
||||
" 2025 Oct 26 by Vim Project fix parsing of remote user names #18611
|
||||
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
@@ -9312,7 +9313,7 @@ endfunction
|
||||
function s:RemotePathAnalysis(dirname)
|
||||
|
||||
" method :// user @ machine :port /path
|
||||
let dirpat = '^\(\w\{-}\)://\(\(\w\+\)@\)\=\([^/:#]\+\)\%([:#]\(\d\+\)\)\=/\(.*\)$'
|
||||
let dirpat = '^\(\w\{-}\)://\(\([^@]\+\)@\)\=\([^/:#]\+\)\%([:#]\(\d\+\)\)\=/\(.*\)$'
|
||||
let s:method = substitute(a:dirname,dirpat,'\1','')
|
||||
let s:user = substitute(a:dirname,dirpat,'\3','')
|
||||
let s:machine = substitute(a:dirname,dirpat,'\4','')
|
||||
@@ -9656,5 +9657,4 @@ let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" }}}
|
||||
|
||||
" vim:ts=8 sts=4 sw=4 et fdm=marker
|
||||
|
||||
Reference in New Issue
Block a user