zsh-workers
 help / color / mirror / code / Atom feed
From: zsugabubus <zsugabubus@national.shitposting.agency>
To: zsh-workers@zsh.org
Subject: Useless assignment in _rm
Date: Sun, 21 Jun 2020 14:09:13 +0200	[thread overview]
Message-ID: <20200621120913.tk5caqwb3ob2r6wt@localhost> (raw)

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
     ;;

             reply	other threads:[~2020-06-21 12:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 12:09 zsugabubus [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200621120913.tk5caqwb3ob2r6wt@localhost \
    --to=zsugabubus@national.shitposting.agency \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).