summary refs log tree commit diff
path: root/Completion/Unix/Command/_rm
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_rm')
-rw-r--r--Completion/Unix/Command/_rm10
1 files changed, 3 insertions, 7 deletions
diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
index 20f44afc5..1f156c481 100644
--- a/Completion/Unix/Command/_rm
+++ b/Completion/Unix/Command/_rm
@@ -32,13 +32,9 @@ _arguments -C $opts \
 
 case $state in
   (file)
-    declare -a ignored
-    ignored=()
-    ((CURRENT > 1)) &&
-      ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
-    ((CURRENT < $#line)) &&
-      ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
-    _files -F ignored && ret=0
+    line[CURRENT]=()
+    line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
+    _files -F line && ret=0
     ;;
 esac