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,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7647 invoked from network); 7 Dec 2022 16:42:23 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Dec 2022 16:42:23 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670431343; b=jU5XfWRMwoxfqz7x3WiTbJnzcmByW9CFANSmeZK1wKzarSNH8Ca+xnl3Xr4N5v7RzpEk1SA7om FeuCRvOr3PccDWkkIpZkbkREN7OZgAOmgqAzDH/16g55JqLghM1UdXTEN2XAqQ6gVASGEeHAvl zmN3MsH5PRlvz6+ZtNrXtLW3PnMCweBnPZ2zxAtN7JwXTVHGDJ95ts3yApZhUe2fxsJph9P6rO wg6sNOYtUlB8r9wxfZ0gGx7f59p2/7LDcYJYiqCN19a7oN+JClL+Ps2nATIY9O1Ddq9h+yGX70 aVsuQUgjgggdMFTu2JIqzhCi1Ep/OjhSS9QKir3Abxt6Zw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ua1-f44.google.com) smtp.remote-ip=209.85.222.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1670431343; bh=T2wAg3F1S9sIVF1Qvj71IZ5rXCCvqIpb0F87BQRIygk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=VV299IllI4Qabfy9TMjNfM9IuKn13U7/H6ItzDA6LG64P/0UxREewBcQYaSIkr65aZlcMoDxyu VAD8coD/ILAyvKwniT3m6paUmmlGmBoss0ciJWubJdHy4oNfRBt7rdVG91eD511HgGxC2P9k7T otch0zJEhzw+Afh+RuZdE7Non3d38Rbz4XVIqxuRl4SstP7i5YWTUMAQkZFykfNOxzkmOnQPYZ 5PrpaB6S4q+NTgl6jcEibD32h/zxe9EvB8iRYZ0OpX1VfAszxqXiaTbDwRuAxRXLyqhIX77Xgs 97jQXtjQlTMQyF5BNpjLldVtFwLkKn7atltkfIzIFF/dZg==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References: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=ipswVQf9gSBXfsN3Cs6Xhk9EbpVxkDvNqvR1QjAowso=; b=PuFdkCsJXw8wZRYkroVJX0Dj76 HEHXx3wxRHX5HcgRFQrCmYLq7sK+MRPPGSyP0UFREfQstbVNxhB/1ZGlWXEfQjY1Hozat8Owo9l2w zYHv4AfSFk2/8ksAm3a68eVEcpSrtJwOX+fxWgfMKtjKJolu1rOsCTusAsZrHzr8zvFFI5D9wBD4k 6xld+brGmUqkWgVMbB6H4Wr5F4SOywMRTLzCmnjTsJDIz+98+QlIk9amZnt4DDgeJa9LA7aiFzYDe quQj0rtNOLlKCLMaFHUlWJIr9/2LFmxD5+as6iUfmlkBCsMGUnHk5vv2lB+Tlkk5MQJv+AEnkjUUk ehucrrcg==; Received: by zero.zsh.org with local id 1p2xV1-000Pze-75; Wed, 07 Dec 2022 16:42:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ua1-f44.google.com) smtp.remote-ip=209.85.222.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ua1-f44.google.com ([209.85.222.44]:39600) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1p2xUj-000PgK-Tn; Wed, 07 Dec 2022 16:42:06 +0000 Received: by mail-ua1-f44.google.com with SMTP id y15so6192440uan.6 for ; Wed, 07 Dec 2022 08:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ipswVQf9gSBXfsN3Cs6Xhk9EbpVxkDvNqvR1QjAowso=; b=etRA1OKijLFvxcfbQDyoJVZGIz3kc2+TG7ez2kOAZ4RsvhpL2AhH9B2AGpTqVDxYV9 WT15HnTdh/Vt9cazPHdWR9D6VPYNx+saR+p7T4OYCoEHAdznhHLt3EjhGc/RZebJ4ggn Ju+nGfplB9T0WOL+bM9fHtGoHg3PjAqyWRpxriDwCwjIhGvJCRVUYQTmG4T7qk2nXegQ 6vzqX70cR+g5jPPO4C/xuiGSyixZdGtZx4QsMljPLyDjq82kEhf8RELlvC/SB1PX9k1j xRGYsJ2Y+yUkKGGzcoTu9a7zhNxZzDK/yvcGNEtKIXzLe1HiN4BYNvsM8PSCdatuWhU5 ZpHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ipswVQf9gSBXfsN3Cs6Xhk9EbpVxkDvNqvR1QjAowso=; b=g2Mm9Rg3+NaZDPEThUHaNhH57PpYancwcx4aorIonDMSvT94NfSnjuZvpbxQAonU6i Qhy2D7hCuo3aUH+061Ryg9kQrtJv8UQCqgJupWBirHUKwokpSiDThHTN9J1t02ybRZ+P IEJuO8Thw2C3jN8VT2y0+A1xJSu6iDOPcrt/y2hPPDzgXoKEqZ6kaoVcNDJcPfFGy30w j2GeJW+GdMcZ7o8aMWYv1xZcXrj7P6q5YgUOQUUyK8WWVeneltvrW0aV+JWYhM2VJMBN OwwHIZ3iQHAfj952CwDLokFViCJt4yeaMXLX6SOnTl4VyFQkEJWig4Ea7yHbioGAqJ7W A8/g== X-Gm-Message-State: ANoB5pkuShHiW1rXHEP141hXlP0oSldEGwGCH/CJwe64GSMZB4Yfz2u1 yauJIXoyCMz6zvBJf2GlWjgeIxjQUU97oWjZTMw= X-Google-Smtp-Source: AA0mqf63NABQIOstGC2XhcxbqYEnawgaBf50v7MbsheUvxFql47KbDHumZTO/mAuyWXs5eNAptkXMKZzMzH9fC0rpsE= X-Received: by 2002:ab0:21ca:0:b0:419:8314:8a79 with SMTP id u10-20020ab021ca000000b0041983148a79mr15398741uan.23.1670431324500; Wed, 07 Dec 2022 08:42:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Philippe Altherr Date: Wed, 7 Dec 2022 17:41:53 +0100 Message-ID: Subject: Re: New problem with ERR_RETURN ? To: Bart Schaefer Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000b7f96105ef3f9938" X-Seq: 51118 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: --000000000000b7f96105ef3f9938 Content-Type: text/plain; charset="UTF-8" I don't think there is a problem. At least not a new problem because Zsh 5.8 and Zsh dev behave the same way. Note that if you replace the body of "f" with just "false" you get the same results. Note also that if you run "return; echo $?" nothing is printed. >From that I concluded that the example behaves correctly. The function "f" returns a non-zero status. Therefore the call to "f" triggers a return, which at the top-level simply exits the script/returns to the command line and thus bypasses what comes next. Philippe On Wed, Dec 7, 2022 at 5:17 PM Bart Schaefer wrote: > After zsh-workers 51001, 51071, 51076 (Philippe A.) > > This seems wrong: > > % setopt errreturn > % f() { > while return 5 > do > echo fail while1 > break > done > } > % f ; echo $? > % > > Note that "echo $?" was not executed when it appears in the same > command line as "f". I don't believe ERR_RETURN should be having an > effect there. > > Compare: > > % f > % echo $? > 5 > % > > --000000000000b7f96105ef3f9938 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I don't think there is a problem. At least not a new p= roblem because=C2=A0Zsh 5.8 and Zsh dev behave the same way.

=
Note that if you replace the body of "f" with just=C2=A0&quo= t;false" you get the same results.

Note also = that if you run "return; echo $?" nothing is printed.
<= br>
From that I concluded that the example behaves correctly. The= function "f" returns a non-zero status. Therefore the call to &q= uot;f" triggers a return, which at the top-level simply exits the scri= pt/returns to the command line and thus bypasses what comes next.

Philippe


On Wed, Dec 7, 2022 at 5:17 PM= Bart Schaefer <schaefer@br= asslantern.com> wrote:
After zsh-workers 51001, 51071, 51076 (Philippe A.)

This seems wrong:

% setopt errreturn
% f() {
=C2=A0 =C2=A0 while return 5
=C2=A0 =C2=A0 do
=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo fail while1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 break
=C2=A0 =C2=A0 done
}
% f ; echo $?
%

Note that "echo $?" was not executed when it appears in the same<= br> command line as "f".=C2=A0 I don't believe ERR_RETURN should = be having an
effect there.

Compare:

% f
% echo $?
5
%

--000000000000b7f96105ef3f9938--