about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Core/_path_files6
1 files changed, 3 insertions, 3 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 2367def63..79b1473c4 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -39,10 +39,10 @@ while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do
          ;;
   W)     tmp1="$OPTARG"
          if [[ "$tmp1[1]" = '(' ]]; then
-           prepaths=( ${^=tmp1[2,-2]}/ )
+           prepaths=( ${^=tmp1[2,-2]%/}/ )
          else
-           prepaths=( ${(P)=${tmp1}} )
-           (( ! $#prepaths )) && prepaths=( ${tmp1}/ )
+           prepaths=( ${(P)^=tmp1%/}/ )
+           (( ! $#prepaths )) && prepaths=( ${tmp1%/}/ )
          fi
          (( ! $#prepaths )) && prepaths=( '' )
          ;;