about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-05-12 10:55:21 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-05-12 10:55:21 +0000
commit11cd9b2de3b8ce3a73260673c5571fecbc95318f (patch)
treefbf2623dadfda977e6eb7e884c5815fffbc98e4c /Completion
parent6e77f38b925e3f37dc69b26efd6173df7281bbe8 (diff)
downloadzsh-11cd9b2de3b8ce3a73260673c5571fecbc95318f.tar.gz
zsh-11cd9b2de3b8ce3a73260673c5571fecbc95318f.tar.xz
zsh-11cd9b2de3b8ce3a73260673c5571fecbc95318f.zip
18512, modified: fix up for ${foo/\//stuf} fix
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_cvs9
-rw-r--r--Completion/Unix/Command/_rsync7
-rw-r--r--Completion/Unix/Type/_path_files3
3 files changed, 11 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_cvs b/Completion/Unix/Command/_cvs
index c0291c46e..ec2b95d0e 100644
--- a/Completion/Unix/Command/_cvs
+++ b/Completion/Unix/Command/_cvs
@@ -611,7 +611,7 @@ _cvs_loadstat () {
 
 (( $+functions[_cvs_root] )) ||
 _cvs_root () {
-  local cvspassfile id
+  local cvspassfile id slash
 
   typeset -gU _cvs_roots
 
@@ -622,7 +622,8 @@ _cvs_root () {
       id="$(LC_ALL=C ls -l "$cvspassfile")"
     fi
     if [[ "$id" != "$_cvs_pass_id" ]]; then
-      _cvs_roots=($_cvs_roots ${${${${(f)"$(<$cvspassfile)"}#/1 }%% *}/:2401\\//:/})
+      slash=/
+      _cvs_roots=($_cvs_roots ${${${${(f)"$(<$cvspassfile)"}#/1 }%% *}/:2401${slash}/:/})
       _cvs_pass_id="$id"
     fi
   fi
@@ -918,13 +919,13 @@ _cvs_existing_entries () {
 (( $+functions[_cvs_modified_entries] )) ||
 _cvs_modified_entries () {
   if _cvs_loadstat; then
-    local expl match linedir realdir pat
+    local expl match linedir realdir pat slash=/
     match=()
     : ${PREFIX:#(#b)(*/)(*)}
     linedir="$match[1]"
     realdir=${(e)~linedir}
     [[ -f "$realdir"CVS/Entries ]] &&
-    [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/\\/[^\\/]#\\///}%/[^/]#/[^/]#}:#${(j:|:)~${${${${(f)"$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"}##*/}/ //}//(#m)[][*?()<|^~#\\]/\\$MATCH}}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] &&
+    [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/${slash}[^${slash}]#${slash}//}%/[^/]#/[^/]#}:#${(j:|:)~${${${${(f)"$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"}##*/}/ //}//(#m)[][*?()<|^~#\\]/\\$MATCH}}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] &&
     _wanted files expl 'modified file' _path_files -g "$pat"
   else
     _cvs_existing_entries
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index 5f2e87fb8..143a7bd4b 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -31,13 +31,14 @@ elif [[ -prefix 1 *:: ]]; then
   _describe "remote modules" remmodules -S/
 
 elif [[ -prefix 1 *: ]]; then
-  local remfiles remdispf remdispd
+  local remfiles remdispf remdispd slash
 
   compset -P 1 '*:'
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
+    slash=/
     remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${${${words[CURRENT
-]#*:}:h}/\\/(#e)/}/\* 2>/dev/null)"})
+]#*:}:h}/${slash}(#e)/}/\* 2>/dev/null)"})
 
     remdispf=(${remfiles:#*/})
     remdispd=(${(M)remfiles:#*/})
@@ -46,7 +47,7 @@ elif [[ -prefix 1 *: ]]; then
       compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/}
       
     _wanted files expl 'remote files and directories' \
-      compadd -S/ -d remdispd ${${(M)remfiles:#*/}/\\/(#e)/}
+      compadd -S/ -d remdispd ${${(M)remfiles:#*/}/${slash}(#e)/}
   else
     _message 'remote files'
   fi
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 664b0d85f..dc12c512d 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -204,7 +204,8 @@ if [[ "$pre" = [^][*?#^\|\<\>]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]
   eval 'realpath=${(e)~linepath}' 2>/dev/null
   [[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1
   pre="${pre#${linepath}}"
-  i="${#linepath//[^\\/]}"
+  i='[^/]'
+  i="${#linepath//$i}"
   orig="${orig[1,(in:i:)/][1,-2]}"
   donepath=
   prepaths=( '' )