Skip to content

Commit ab4ebb6

Browse files
committed
patch 9.2.0302: runtime(netrw): RFC2396 decoding double escaping spaces
Problem: runtime(netrw): RFC2396 decoding double escaping spaces (lilydjwg, after 3e60f03) Solution: Remove escape() call, since we are using fnameescape() anyhow fixes: #19913 Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent f07a1ed commit ab4ebb6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

runtime/pack/dist/opt/netrw/autoload/netrw.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
" 2026 Feb 27 by Vim Project Make the hostname validation more strict
2424
" 2026 Mar 01 by Vim Project include portnumber in hostname checking #19533
2525
" 2026 Apr 01 by Vim Project use fnameescape() with netrw#FileUrlEdit()
26+
" 2026 Apr 05 by Vim Project Fix netrw#RFC2396() #19913
2627
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
2728
" Permission is hereby granted to use and distribute this code,
2829
" with or without modifications, provided that this copyright
@@ -8826,8 +8827,7 @@ endfunction
88268827

88278828
" netrw#RFC2396: converts %xx into characters {{{2
88288829
function netrw#RFC2396(fname)
8829-
let fname = escape(substitute(a:fname,'%\(\x\x\)','\=printf("%c","0x".submatch(1))','ge')," \t")
8830-
return fname
8830+
return substitute(a:fname, '%\(\x\x\)', '\=printf("%c","0x".submatch(1))', 'ge')
88318831
endfunction
88328832

88338833
" netrw#UserMaps: supports user-specified maps {{{2

src/testdir/test_plugin_netrw.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,4 +604,9 @@ func Test_netrw_FileUrlEdit_pipe_injection()
604604
call assert_false(filereadable(fname), 'Command injection via pipe in file URL')
605605
endfunc
606606

607+
func Test_netrw_RFC2396()
608+
let fname = 'a%20b'
609+
call assert_equal('a b', netrw#RFC2396(fname))
610+
endfunc
611+
607612
" vim:ts=8 sts=2 sw=2 et

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
302,
737739
/**/
738740
301,
739741
/**/

0 commit comments

Comments
 (0)