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 11213 invoked from network); 18 Jul 2021 22:32:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Jul 2021 22:32:28 -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:Content-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=aDlOEWnle5Iv+pySDfewxrP5DKIIWvo1KoSrbKYo96A=; b=vlmNYIbSXTDA5tg3qv6uSV/kqx kglWZ9CkYP1Ae35GWArgjnWl3kwTfoYtm0A7ZnThlTjOTjmPqxUFFkL4aV1tPiMWpg/4jibmxQSho aYzYZBfC0jkd5Uiwje+J0HIFDoFi1rlIa+/s2redS641uu30Nt2I3JTFfoKNFlzdIfaijZSGSZwoY c9DlLEAT/yOhotb3kMnQ8zdwdNr+E20bOVt/ySBGtXfnB9bZl9oKMObdX68J4UlkssAPANHZnOU/c cUdt11dO+oP8Ls/n5U1FFKyUQntlH4L4m1HnJ5cbF8fFNvKoKUNl8Tr2GKydcrHyhTZUuLBE1ZDSp 1saz+Bmw==; Received: from authenticated user by zero.zsh.org with local id 1m5FKm-000CJx-8l; Sun, 18 Jul 2021 22:32:28 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1m5FKW-000C0a-4n; Sun, 18 Jul 2021 22:32:12 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id EABEB27C0054; Sun, 18 Jul 2021 18:32:10 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Sun, 18 Jul 2021 18:32:10 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdelgddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderreejnecuhfhrohhmpefnrgifrhgv nhgtvggpgggvlhojiihquhgviicuoehlrghrrhihvhesiihshhdrohhrgheqnecuggftrf grthhtvghrnhepieekjeevledugeefiefgueelgffgtddtgeehvedvhedviefghedvffeu vddvueehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eplhgrrhhrhihvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudehudek jeejtdegqdduudelvdejfeekhedqlhgrrhhrhihvpeepiihshhdrohhrghesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9C4F9A03981; Sun, 18 Jul 2021 18:32:10 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-533-gf73e617b8a-fm-20210712.002-gf73e617b Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Sun, 18 Jul 2021 18:31:49 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: zsh-workers@zsh.org Cc: "Marlon Richert" Subject: Re: [PATCH] Fix a logic bug in _zle Content-Type: text/plain X-Seq: 49172 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 Tue, Jun 1, 2021, at 4:53 AM, Marlon Richert wrote: > On Tue, Jun 1, 2021 at 12:56 AM Bart Schaefer wrote: > > > > On Mon, May 31, 2021 at 10:49 AM Marlon Richert > > wrote: > > > > > > On Mon, May 31, 2021 at 8:08 PM Bart Schaefer wrote: > > > > > > > > For purposes of the commit log, we should be told what this means in > > > > terms of a behavior change. > > > > > > Is it good enough this way? > > > > Better, but you could have just said that in the email text rather > > than embed it in the patch file. > > Ah, OK. I thought you meant I should include it in the patch itself. > > > However, I can't figure out when $state[1] == widget-function is ever > > true. Did you possibly mean widget-or-function ? If not, can you > > give an example? > > Sorry, typo. Yes, I meant widget-or-function. But actually, I realize > now that I made further mistakes in my explanation yesterday evening. > I'll try to explain better. > > What happens in the unpatched _zle code is this: > * On line 54, `;&` causes the (widget*) case to always proceed to the > (function) case. > * On line 56, `[[ $state[1] != *function ]] ||` checks to see whether > the flow should actually continue from (widget*) to (function). > * However, > * when `[[ $state[1] != *function ]]` is true, > * then we correctly skip the _wanted call on lines 57-58, > * but because the _wanted call is followed by `&& ret=0` > * and because || and && have equal precedence and are left associative, > * then we incorrectly do `ret=0`, > > So, to correctly summarize the bug: When $state[1] == widget, _zle > always returns 0, instead of returning 0 for success and non-zero for > failure. The patch fixes this. If you could update the commit message > accordingly, that would be great. ping for further feedback on or committing of 48969 -- vq