about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-15 13:09:11 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-15 13:09:11 +0000
commitd9ffb668fa53c3e74fa1bd86e04817b67f04b8e9 (patch)
tree4dbb3ef025dffe182a51828651e45ccd410c6ce4
parent0450ded1063bfb32794db50b97cadf5a6bcfdb30 (diff)
downloadzsh-d9ffb668fa53c3e74fa1bd86e04817b67f04b8e9.tar.gz
zsh-d9ffb668fa53c3e74fa1bd86e04817b67f04b8e9.tar.xz
zsh-d9ffb668fa53c3e74fa1bd86e04817b67f04b8e9.zip
manual/8276
-rw-r--r--Completion/User/_urls21
1 files changed, 11 insertions, 10 deletions
diff --git a/Completion/User/_urls b/Completion/User/_urls
index ffbbcf98d..515f9aa40 100644
--- a/Completion/User/_urls
+++ b/Completion/User/_urls
@@ -71,11 +71,13 @@ case "$scheme" in
   file)
     if ! compset -P //; then
       if [ -prefix / ]; then
-	_files "$@"
+	_path_files "$@" -S '' -g '*(^/)' && ret=0
+	_path_files "$@" -S/ -r '/' -/ && ret=0
       elif [ ! "$PREFIX" ]; then
-	compadd -S '/' - "${PWD%/}"
+	compadd -S '/' -r '/' - "${PWD%/}"
+	ret=0
       fi
-      return
+      return $ret
     fi
   ;;
   bookmark)
@@ -85,7 +87,7 @@ case "$scheme" in
     else
       _description expl 'bookmark'
       _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' && ret=0
-      _path_files -W "$urls_path/$scheme" -S/ -r '' -/ && ret=0
+      _path_files -W "$urls_path/$scheme" -S/ -r '/' -/ && ret=0
     fi
     return $ret
   ;;
@@ -95,8 +97,7 @@ esac
 if ! [[ -prefix */* ]]; then
   dirs=($urls_path/$scheme/$PREFIX*$SUFFIX(/:t))
   (( $#dirs )) || _hosts -S/ && ret=0
-  [ "$scheme" = "http" ] && 
-    dirs=($dirs $localhttp_servername)
+  [ "$scheme" = "http" ] && dirs=($dirs $localhttp_servername)
   compadd "$@" -QS/ - $dirs && ret=0
   return $ret
 fi
@@ -104,23 +105,23 @@ fi
 # Complete part after hostname
 host=${PREFIX%%/*}
 compset -P "$host/"
-if [[ "$compconfig[urls_localhttp]" = ${host}:* ]]; then
+if [[ "$localhttp_servername" = $host ]]; then
   if [[ -prefix \~ ]]; then
     compset -P \~
     if [[ -prefix */* ]]; then
       user=${PREFIX%%/*}
       compset -P $user/
       _path_files -W ~$user/$localhttp_userdir -g '*(^/)' && ret=0
-      _path_files -W ~$user/$localhttp_userdir -S/ -r '' -/ && ret=0
+      _path_files -W ~$user/$localhttp_userdir -S/ -r '/' -/ && ret=0
     else
       _users -S/ && ret=0
     fi
   else
     _path_files -W $localhttp_documentroot -g '*(^/)' && ret=0
-    _path_files -W $localhttp_documentroot -S/ -r '' -/ && ret=0
+    _path_files -W $localhttp_documentroot -S/ -r '/' -/ && ret=0
   fi
 else
   _path_files -W $urls_path/$scheme/$host/ -g '*(^/)' && ret=0
-  _path_files -W $urls_path/$scheme/$host/ -S/ -r '' -/ && ret=0
+  _path_files -W $urls_path/$scheme/$host/ -S/ -r '/' -/ && ret=0
 fi
 return $ret