summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2012-12-08 10:37:07 +0200
committerVille Skyttä <ville.skytta@iki.fi>2012-12-08 10:37:07 +0200
commit41a37d767940af7928282874618e3dc60549de54 (patch)
tree139f02365f69212db5254750d909af27c6159d9a
parentff11fed5f8f1d73b02d515da3af335644807ab4d (diff)
downloadbash-completion-41a37d767940af7928282874618e3dc60549de54.tar.gz
scp: Treat strings with slash before colon or starting with [.~] as local.
-rw-r--r--completions/ssh8
1 files changed, 4 insertions, 4 deletions
diff --git a/completions/ssh b/completions/ssh
index 590ad88d..9030aab6 100644
--- a/completions/ssh
+++ b/completions/ssh
@@ -343,10 +343,10 @@ _scp()
_expand || return 0
- if [[ "$cur" == *:* ]]; then
- _scp_remote_files
- return 0
- fi
+ case $cur in
+ !(*:*)/*|[.~]*) ;; # looks like a path
+ *:*) _scp_remote_files ; return 0 ;;
+ esac
if [[ "$cur" == -F* ]]; then
cur=${cur#-F}