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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1514 invoked from network); 16 Nov 2022 02:42:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2022 02:42:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; 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=hQnCdWQkAFlQvG+CWAMbpWYOTsoOJ2gMELQJJaAPD+Q=; b=CVk3fyGz39sScdqP8Oy4pwDZmD iHqhE+K0VzE/EY2Y/Mb4GvL+tG3AHHMyRAhwtR/D80KQgpRrkDuaM7BmA/TawYUoM/Jh/NYANXcHm SFew5KsGOvZZdEPE37K+JOnS4evZFISNuEV7372EBqXpji+YhOCzbeAaKuSJv4E3ppQ3lHcKAVupA oFMgkhdNf4rSXdkbkcR+qhObJZoWzyQsa/nY03UnpNjUiRt30Wf2dwDsPCQYABTiW/A3aAi0uNOa6 hVwzX898PK/wQ/Jlb56mqJnjWsTCB6jPPv50XwJWc6N3kHY45jkbTJg7ysVHBrFU/BdATO2T2686G Ikmz7uYw==; Received: by zero.zsh.org with local id 1ov8Nf-000DHN-4o; Wed, 16 Nov 2022 02:42:27 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ov8NM-000Cw1-JQ; Wed, 16 Nov 2022 02:42:08 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 82E6527C0054; Tue, 15 Nov 2022 21:42:06 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Tue, 15 Nov 2022 21:42:06 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeehgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreerjeenucfhrhhomhepnfgrfihr vghntggvucggvghljoiiqhhuvgiiuceolhgrrhhrhihvseiishhhrdhorhhgqeenucggtf frrghtthgvrhhnpeeuheffffffgfejledvhfeffeehgeehkefgvdeugeetgeeuteeuieeu heevhfeuleenucffohhmrghinhepughothhtihhnghdrshhhnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhihvodhmvghsmhhtphgr uhhthhhpvghrshhonhgrlhhithihqdduudehudekjeejtdegqdduudelvdejfeekhedqlh grrhhrhihvpeepiihshhdrohhrghesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: iaa214773:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 60F5731A0063; Tue, 15 Nov 2022 21:42:06 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <68e48647-7713-4b77-b719-d836d2671b06@app.fastmail.com> In-Reply-To: References: Date: Tue, 15 Nov 2022 21:41:27 -0500 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Philippe Altherr" , "Bart Schaefer" Cc: zsh-workers@zsh.org Subject: Re: [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT) Content-Type: text/plain X-Seq: 50975 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, Nov 15, 2022, at 2:18 PM, Philippe Altherr wrote: > Here is a patch with which all tests pass (the Zsh ones, including the > new ones that the patch adds, and my tests mentioned in this thread). Here are two additional cases that your patch does not cover. They are not regressions, as stable zsh 5.9 is also affected. As you've mentioned several times, POSIX states: If the exit status of a compound command other than a subshell command was the result of a failure while -e was being ignored, then -e shall not apply to this command. This implies that ignored non-zero exit statuses may "bubble up" until reaching a (...) command or a simple command. You've already mentioned function calls, but *any* simple command that derives its exit status from "the last command executed" should be able to trigger early exit. At a minimum, this includes the dot/source and eval commands, neither of which currently behaves correctly. ----- % cat /tmp/dotting.sh; echo . /tmp/dotted.sh echo done % cat /tmp/dotted.sh; echo if true; then false && true fi % bash -e /tmp/dotting.sh; echo $? 1 % ksh -e /tmp/dotting.sh; echo $? 1 % dash -e /tmp/dotting.sh; echo $? 1 % yash -e /tmp/dotting.sh; echo $? 1 % zsh -e /tmp/dotting.sh; echo $? done 0 % Src/zsh -e /tmp/dotting.sh; echo $? done 0 ----- % cat /tmp/eval.sh; echo eval 'if true; then false && true; fi' echo done % bash -e /tmp/eval.sh; echo $? 1 % ksh -e /tmp/eval.sh; echo $? 1 % dash -e /tmp/eval.sh; echo $? 1 % yash -e /tmp/eval.sh; echo $? 1 % zsh -e /tmp/eval.sh; echo $? done 0 % Src/zsh -e /tmp/eval.sh; echo $? done 0 -- vq