zsh-workers
 help / color / mirror / code / Atom feed
* Useless assignment in _rm
@ 2020-06-21 12:09 zsugabubus
  2020-06-21 13:32 ` Daniel Shahaf
  0 siblings, 1 reply; 5+ messages in thread
From: zsugabubus @ 2020-06-21 12:09 UTC (permalink / raw)
  To: zsh-workers

Hi!

As much as I understand, the assignment is not needed because in the
next line the whole array will be reassigned.

It caused issues with `rm -r<TAB> anything`:
  _rm:72: line: assignment to invalid subscript range
  _rm:72: line: assignment to invalid subscript range

-- 
zsugabubus

diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
index ea9190d..82b382b 100644
--- a/Completion/Unix/Command/_rm
+++ b/Completion/Unix/Command/_rm
@@ -69,7 +69,6 @@ _arguments -C -s -S $opts \

 case $state in
   (file)
-    line[CURRENT]=()
     line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
     _files -F line && ret=0
     ;;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-28 13:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-21 12:09 Useless assignment in _rm zsugabubus
2020-06-21 13:32 ` Daniel Shahaf
2020-06-22 10:27   ` zsugabubus
2020-06-23 12:40     ` Daniel Shahaf
2020-06-28 13:13       ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).