Fix completion of remote scp filenames with spaces.

Backslash escaping adds 3 backslashes, of which we want to remove 2,
not 4 when unescaping.
This commit is contained in:
Ville Skyttä 2009-11-28 11:57:57 +02:00
parent 3191d14a55
commit ff0f741dcf
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ bash-completion (2.x)
* Apply pine completion to alpine too.
* Remove many unnecessary short option completions where long ones exist.
* Improve configure, cvs, gkrellm, lftp, mdadm, modprobe, mplayer,
mysqladmin, service, ssh, and general hostname completions.
mysqladmin, service, scp, ssh, and general hostname completions.
* Add abook and wtf completion, based on work by Raphaël Droz.
* Add k3b and lftpget completion.
* Don't overwrite other host completions when completing from multiple

View File

@ -177,7 +177,7 @@ _scp()
userhost=${cur%%?(\\):*}
path=${cur#*:}
# unescape spaces
path=${path//\\\\\\\\ / }
path=${path//\\\\ / }
if [ -z "$path" ]; then
# default to home dir of specified user on remote host
path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null)