From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1627 invoked from network); 21 Jun 2020 12:10:14 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 21 Jun 2020 12:10:14 -0000 Received: (qmail 7225 invoked by alias); 21 Jun 2020 12:10:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: Sender: zsh-workers@zsh.org X-Seq: 46088 Received: (qmail 26368 invoked by uid 1010); 21 Jun 2020 12:10:06 -0000 X-Qmail-Scanner-Diagnostics: from mail.cock.li by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25842. spamassassin: 3.4.4. Clear:RC:0(37.120.193.124):SA:0(-0.6/5.0):. Processed in 3.192968 secs); 21 Jun 2020 12:10:06 -0000 X-Envelope-From: zsugabubus@national.shitposting.agency X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: fail (ns1.primenet.com.au: SPF record at national.shitposting.agency does not designate 37.120.193.124 as permitted sender) Date: Sun, 21 Jun 2020 14:09:13 +0200 From: zsugabubus To: zsh-workers@zsh.org Subject: Useless assignment in _rm Message-ID: <20200621120913.tk5caqwb3ob2r6wt@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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 ;;