From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 8C38026D47 for ; Wed, 26 Jun 2024 23:44:04 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1719438244; b=aNWpUeCxG2tRMJUwJayh7pdNPJwObNlNRzAsJMwUomh3e6PF1nBKfSbsLgy+j7ak0GtKol3LUx zrpvu+rhMaTdHqkHJ7u2IKbqKHgFcdwmFWRQOMah78vpw26IGivlne+82hQPS2VPU/QKEfPjIA J1XwL0kpfhXpNXPQS5P+rDnz4TQzoxIcw4kEFA76iSKNUDpOn2c+ATTS8npcdOkr0sn/lwlbOt cx/aU8Gwa9wWCv2LP1v3uGrIVrK8DWzteBW9gal1q7yvlMia3xWws4bRMMr8hPrqrxvCi6Tqxm sojlfVqCclZbbUG2TWOTF9w6VRMTRY/ua4y64d8zMsD2+w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f53.google.com) smtp.remote-ip=209.85.167.53; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1719438244; bh=HtdmgDz6+Ckxm94Kswhx0vL64y5ZugCCXfeL94GgGQQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=XnPk6xdwvE57E8Yqj1t/KqN5ekzOAx7EIwh3ShwMUtykRDcFxWIS2FWR7NQuRGlLhIbAgg/iRX vqBL1NTBcHUCDRjjifW23wHQ4tu5Gq1p3AnYDk5Pa4APZJJ6LJreK84sUOTxcOsxghloq++PPr kq7K9dyblVm3ayVrzXBJ5cAVMYFAXTQWX+l9R5xHWofEPOLE+sSkZruc9DO+usWs44D8YAwbBz oASB3IA1vndx2uY7hNxMfdYF420iQ9AQIIQssOqDt3FF3AUR/RUFMy5dIi0PbJ3f6AWBqbzSLR j22m2V7klAeVYMouDX+N38joIfr8M/Y7nw+xWazjJsBcfg==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+WBz8pTyLNJM7e+/OclXS+KC3A7c+F0aTZPzM9Hdxac=; b=I0XH08KCEMsdGvhatAHblslxjs fV5HQiHDEAj9KIuzTzmfzxKywbqst5BtB/dDAh/I8cjCVi8elw8RTNZv2f3FwiyIJV2F/QtlYhW8n JE/Vs7JcTXwUyUkTVuYFf27hiY3PxO+uI6wXp6BC6jFdYBRxVhBktveBtd1FesFDRCAjUnlF2OlLg wdxH9rN5D+241hn+85GHCUs+oaVd/rtumGqxy1kJ3xcncekvWJD4wXPkHuLMs+fmJ8D7pH6bpBnJK /qK4e9MIFLl7OuIwaxIHKX15Vv+TCecJUdqTwKzhToW2WPM5LNPyd31Fv1v47h4wT2ND5bNP/0/cf gPRne39Q==; Received: by zero.zsh.org with local id 1sMaQs-0008sS-GR; Wed, 26 Jun 2024 21:44:02 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f53.google.com) smtp.remote-ip=209.85.167.53; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-lf1-f53.google.com ([209.85.167.53]:53708) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1sMaQa-0008a9-Cp; Wed, 26 Jun 2024 21:43:46 +0000 Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-52ce6c93103so4974014e87.3 for ; Wed, 26 Jun 2024 14:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1719438223; x=1720043023; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+WBz8pTyLNJM7e+/OclXS+KC3A7c+F0aTZPzM9Hdxac=; b=kgjUionDo+DeYbF84YTaYztOZ1VJHjFxfmV5e3rWlp4jTx8Jg9V6QsXCyvheD6ZWGt 7exiIYvxFfnwMEC6FoKVdzUdjHybTp2kIV13UVIG0LyjxhcHiYSPs/ah/ar1M6b+6c2J pLu9H2W0FGblMg3sxydKiZ6Z7/ZOiRMhCotHEd3qJEuxyDqIHb8OLA0Cxs9B2A8hJ/SN vRqmb8mIa8xjDEZkeL8M6RQpydhbZK+/FQ4LmqYCHa/js2L+g+9dBDfMIk1t8S59ECRp kqhmNFaGPtHYk11d6uwOGLA/Wr+wkZPXje/N3cuSXoYXRMwTokSwIIEXoaoHk1cGe1kJ zNOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719438223; x=1720043023; h=content-transfer-encoding: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=+WBz8pTyLNJM7e+/OclXS+KC3A7c+F0aTZPzM9Hdxac=; b=LQclj3XJHpmcIoSbV+oCH8O4g9SZmBnBildVxf5GwpnRJNlu/ytzCyMHo9Kdvpm4ZV 8zzxnk5PK1ueRrirS2ciSgHzTG2leNvSq8+KCw00CdyDLUyP+0VeGjZeQd/99+Wo2/xM 1RM7jPUWEndqq+Im4xJOyYR4Z/pH6eEe8WnRYDUopvSBPOs5XGmIN0PWafItB84J+WHL hzhbCAR7pu2BYqQKv8cSIrD0YCaccAvzEefxZLyNXLjVQTb+2/PLbFaKSE9oyUZlzZne xlhjtBqvls1nq8VGUZyVqUQqDcpVu/o6qF/isCbgF9atUnlw+lpx33NmoqvT/r81hlei j0UA== X-Gm-Message-State: AOJu0YzJ6GwsB7c7KO+FUHSIHMbrNCYnjhSmk1QQMtP+Gg7VLZZ2qNlv ZMqaTwWCd1YOKcz2IAF0pBRoCB0FGLQs5LM8ivIAN2xG1Aoe9S7q9ktXoIi7lkYlegsW10hF4nD 0sYpmOH4KUO98afHiPCv6m850MUtxuIWehKdt X-Google-Smtp-Source: AGHT+IG9tRXFavXjvvjO/9mSoDWUQ1ZtgbpXDMJ7wsZNffKLdI5P51qYt39UfCOeQDoBfDWWVgm+NT1moBPO2Qhy3cs= X-Received: by 2002:a19:f00d:0:b0:52c:df36:1041 with SMTP id 2adb3069b0e04-52ce1835a75mr8064611e87.40.1719438223301; Wed, 26 Jun 2024 14:43:43 -0700 (PDT) MIME-Version: 1.0 References: <5d54375e-8673-45f0-b5ac-f5e0e233d56f@inlv.org> <2a5f0fa7-23bf-4069-b237-d304965f142e@app.fastmail.com> <33ca21c3-69f8-49f7-9350-2ff9cc4febca@app.fastmail.com> In-Reply-To: From: Bart Schaefer Date: Wed, 26 Jun 2024 14:43:32 -0700 Message-ID: Subject: Re: errexit and (Z)ERR trap regression To: Philippe Altherr Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52976 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 Wed, Jun 26, 2024 at 5:43=E2=80=AFAM Philippe Altherr wrote: > > I think that the correct fix is the following: > > if (isandor || isnot) > noerrexit =3D oldnoerrexit | NOERREXIT_EXIT | NOERREXIT_RETURN; > else > noerrexit =3D oldnoerrexit; This doesn't seem necessary to me. For one thing, it's equivalent to: noerrexit =3D oldnoerrexit; if (isandor || isnot) noerrexit |=3D NOERREXIT_EXIT | NOERREXIT_RETURN; But assigning (noerrexit =3D oldnoerrexit) presumes that noerrexit was (improperly?) cleared at or after the point where olderrexit was recorded. If that were the situation, then -- > For reminder, here is the current code: > > if (isandor || isnot) > noerrexit |=3D NOERREXIT_EXIT | NOERREXIT_RETURN; -- would be insufficient for the existing test cases, I think. That is, either (olderrexit =3D=3D noerrexit), or it's not necessary to OR-together olderrexit with the new values. > Here are two other examples fixed by this patch: > > zsh -c 'trap "echo Trapped!" ERR; true && if true; then false; fi' > zsh -c 'trap "echo Trapped!" ERR; true && {false} always {true}' These two cases also pass with my patch from workers/52973. Do you have an example where my patch doesn't work?