patch 9.2.0302: runtime(netrw): RFC2396 decoding double escaping spaces
Commit:
https://github.com/vim/vim/commit/ab4ebb62ee2cbe5e25fb1746ac5dbe63a9d50260
Author: Christian Brabandt <[email protected]>
Date: Sun Apr 5 16:34:24 2026 +0000
patch 9.2.0302: runtime(netrw): RFC2396 decoding double escaping spaces
Problem: runtime(netrw): RFC2396 decoding double escaping spaces
(lilydjwg, after 3e60f03d942d6bb0f7eac)
Solution: Remove escape() call, since we are using fnameescape() anyhow
fixes: #19913
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim
b/runtime/pack/dist/opt/netrw/autoload/netrw.vim
index 1520ff969..8e5fdb539 100644
--- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim
+++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim
@@ -23,6 +23,7 @@
" 2026 Feb 27 by Vim Project Make the hostname validation more strict
" 2026 Mar 01 by Vim Project include portnumber in hostname checking #19533
" 2026 Apr 01 by Vim Project use fnameescape() with netrw#FileUrlEdit()
+" 2026 Apr 05 by Vim Project Fix netrw#RFC2396() #19913
" 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
@@ -8826,8 +8827,7 @@ endfunction
" netrw#RFC2396: converts %xx into characters {{{2
function netrw#RFC2396(fname)
- let fname =
escape(substitute(a:fname,'%\(\x\x\)','\=printf("%c","0x".submatch(1))','ge'),"
")
- return fname
+ return substitute(a:fname, '%\(\x\x\)', '\=printf("%c","0x".submatch(1))',
'ge')
endfunction
" netrw#UserMaps: supports user-specified maps {{{2
diff --git a/src/testdir/test_plugin_netrw.vim
b/src/testdir/test_plugin_netrw.vim
index 2e5da13d7..b23467092 100644
--- a/src/testdir/test_plugin_netrw.vim
+++ b/src/testdir/test_plugin_netrw.vim
@@ -604,4 +604,9 @@ func Test_netrw_FileUrlEdit_pipe_injection()
call assert_false(filereadable(fname), 'Command injection via pipe in file
URL')
endfunc
+func Test_netrw_RFC2396()
+ let fname = 'a%20b'
+ call assert_equal('a b', netrw#RFC2396(fname))
+endfunc
+
" vim:ts=8 sts=2 sw=2 et
diff --git a/src/version.c b/src/version.c
index d25ba8f0e..ba00c5a7b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 302,
/**/
301,
/**/
--
--
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 visit
https://groups.google.com/d/msgid/vim_dev/E1w9f6x-006Xg8-5x%40256bit.org.