Hi list.

When open scp protocol URLs, netrw call scp command like below.

scp -q host:path C:\path\to\temp\dir\file.txt

But scp.exe (not pscp) command handle the path as:

* C is hostname
* \path\to\temp\dir\file.txt is a remote path.

Below is a patch to fix this issue. This patch works only for scp.exe (bundled 
msysgit).

- Yasuhiro Matsumoto

diff -r cd7c730a3d42 runtime/autoload/netrw.vim
--- a/runtime/autoload/netrw.vim    Tue Sep 09 23:11:50 2014 +0200
+++ b/runtime/autoload/netrw.vim    Fri Sep 12 20:45:18 2014 +0900
@@ -1990,7 +1990,14 @@
      let useport= ""
     endif
 "    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." 
".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
-    exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." 
".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)
+    " 'C' in 'C:\path\to\file' is handled as hostname on windows.
+    " This is workaround to avoid mis-handle windows local-path:
+    if g:netrw_scp_cmd =~ '^scp' && (has("win32") || has("win95") || 
has("win64") || has("win16"))
+      let tmpfile_get = substitute(tr(tmpfile, '\', '/'), 
'^\(\a\):[/\\]\(.*\)$', '/\1/\2', '')
+    else
+      let tmpfile_get = tmpfile
+    endif
+    exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." 
".shellescape(g:netrw_machine.":".b:netrw_fname,1)." 
".shellescape(tmpfile_get,1)
     let result           = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
     let b:netrw_lastfile = choice

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui