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=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13032 invoked from network); 29 May 2021 23:38:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 May 2021 23:38:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ivii0DROZywBrRgg4GIrCEiydnau5T4Da34L8vsY9+4=; b=Bkd+3ptnsAMDjySr6bVPttRFwz H+g0haHGppMae6R4iTfGzw3gmyXFEeXTu3bCgHaKPBkaCFY5xddKbCoFoQw8w6inQtv/wDS7I/Qre cdR0EG8xSJBMXvc8UemNQvZhuHxGB/jAlqQUTGXEB8Tw83ZcRwe2hUaPksGPhAD7WKpHeiaDdW8FC cZW8HdMTZCFFsjgQElO/fXtgKMAXpMsbc76C9VBHwXLEUoaspq4dgIVulc0fIOBEm54NxPJKgsXBs 6BC7QrfL5rRE3K2ecwusT7B7VSd7X7NPWreFRuayZ685Np4x888V8kr6Sg2/rtec/SEj5tdYNhRZL 5WSUFXuw==; Received: from authenticated user by zero.zsh.org with local id 1ln8XB-0002QK-To; Sat, 29 May 2021 23:38:25 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ln8X0-00028j-GL; Sat, 29 May 2021 23:38:14 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1ln8Wz-000JRM-Oz for zsh-workers@zsh.org; Sun, 30 May 2021 01:38:13 +0200 In-reply-to: From: Oliver Kiddle References: To: Zsh hackers list Subject: Re: [BUG] Zsh crashes when reverse-menu-complete is invoked during complist MENUSELECT without 'menu:' in $compstate[insert] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <74730.1622331493.1@hydra> Date: Sun, 30 May 2021 01:38:13 +0200 Message-ID: <74731-1622331493.771443@x2v5.xEC7.Evn2> X-Seq: 48954 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 27 May, Marlon Richert wrote: > Given: > * complist's MENUSELECT mode is active > * $compstate[insert] does not start with 'menu:' > When: > * The user activates reverse-menu-complete. > Then: > * Zsh crashes. It calls reversemenucomplete() which is a function that pre-dates menu selection. The path down which it clears minfo didn't look appropriate from within menu selection. But it doesn't crash for forward menu completion. Taking the same code path as for forward completion but with zmult negated appears to work fine and would seem logical enough. But perhaps there's some aspect to reversemenucomplete() that would be needed so it'd be good if this can get some further testing. Oliver diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 429c8159f..353cb3562 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -3277,9 +3277,8 @@ domenuselect(Hookdef dummy, Chdata dat) !strcmp(cmd->nam, "reverse-menu-complete")) { mode = 0; comprecursive = 1; - unmetafy_line(); - reversemenucomplete(zlenoargs); - metafy_line(); + zmult = -zmult; + do_menucmp(0); mselect = (*(minfo.cur))->gnum; setwish = 1; mline = -1;