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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5809 invoked from network); 13 Nov 2022 04:11:36 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Nov 2022 04:11:36 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668312696; b=YxB/ssRJBaNyszWKTz5Z4YdqOCf2DdpcjzYD+Bbm5v3kGPvHw4JiWzn+A6M+Ca7r8Tu3BxbA6B cBaygKMbzxs6PdBk0r9Dr33x66bhIKK5YbfXPjOjcxhjGo1xs/27TTSd35NTbH8u+X4xX2L6d9 HHmlJO4+nfJywZMyp3mKZsw8fefHTdytpOaTxal/c/ddoUa6XCNF9B22Hzwza1kf/b1yhCqHXz kB3GghGNykj7Lw17j8yHDPF1ZZN3VTe2GCoFoRTew9zZiqmqkuP0gRgP7kbHArf2WATq1s5UOm DthFLwYDT6QpsLvfrgH21e9UwSIltpM4XkFbTuGBPCD2Ng==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 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=1668312696; bh=JXw+9RiszykptsC5JP6yWyfAbODkPXrQEjHD+aBRIpA=; 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=gXCqHHmY8Hl2keybwei2Atsihj+PEtMCPPrJHY3qkITNQPp40wGT3xjcxco2pKazhzZPWKl6Zx ts3KvvLNXr84jJIb2BWVhqfdHNEfu3+ZChvlsEW+x22SeDqknJ/JhKRf6Ge30Cn8+hzOmtZnUE VDWj9DUpzjrZjP6UJzfoAV/5/6cGPJi7VVoLgOy4y8WDK6PUeB4ZRN7/aK73tOnD6qgoYyKy9K jHvBj/RVbEgilELm61TB0wNAMrIp+HQb4dUxVOm60QKvWN4ky+WnnxUXcdkzjYJAXLghpkf1yA I1mK2x+0/xmxSACfaJJhNmHzXSh8lk/V5daekva25t9wqQ==; 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=a9mZ//o+FrKTDxU25FGDR//JfS780uQiGuNNEMb+phI=; b=VJoIQFNyJ9vUPfjzPQqKgzVSm3 EansCOvOmCPc9VqRN8uWr1t5ilkXAYMzZCM+7BPucc2ynveH6nSlUqfQgqJjqDo84Wp89iRR5yYl9 B+zqh6lpMj+8AaTc1CDEIm3r2kIv++pk44GAkNvZw0Mt/Oc+GSIuntrUvBTyYuf5Tihg5H2uwdPAr jP4x2olaqLAomgXDJAKQL7rIvAIrRozNZUJfTuSl2hMwFpQ4HmGtgG55+vcd5ZPFKxxxtQFjEgMMv CGTQ1vfHZpkVAs7q4P485/1hHLzL0w5DPLtRZrnsg8QyIJRaHRlvhmACAdt6fhN8acvqs6vLNP8j7 O5iwGuEg==; Received: by zero.zsh.org with local id 1ou4LH-000Ehq-JK; Sun, 13 Nov 2022 04:11:35 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f50.google.com ([209.85.208.50]:45630) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ou4Kv-000EN4-Nr; Sun, 13 Nov 2022 04:11:14 +0000 Received: by mail-ed1-f50.google.com with SMTP id a67so12793843edf.12 for ; Sat, 12 Nov 2022 20:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.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=a9mZ//o+FrKTDxU25FGDR//JfS780uQiGuNNEMb+phI=; b=vD6PcZ6owy5BSUPs/mRHI3rXqPeJieZU6iKhUelUib1b178bqqzHbZSkgBRVq9PHnm wWeFbPTbbsARm0AVsx6uU/RjqeIyjoU44W50/WcrqSvjTuIlw3pzIapdS1nRhCG+eLYA MDb6sHa2sl2O2cBVxXehwaogsQxPwOms+H6fY456ShwyU6HvYw9rxtC1bX+6IShgV1Kh fknyxmZVoSA8rCQDEwJ26ifPzsPjXs84U9mIR466M6yrLngCJ7manSE2TOnBzZyDmMo5 NSVBIFs1ADATzBIZJcezuyzVifi8QL02HEdoJJ2ZKH803l110LxPnnyh7hRhHq4sSgbH xBRw== 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=a9mZ//o+FrKTDxU25FGDR//JfS780uQiGuNNEMb+phI=; b=VuWAfJSOth8APfDG9tAdYxp3UlIVp2X+KcziQt3EZsVznY+Mi+MQtAE4gG9G1umh9d ZpUPJVHPtXUWv0M0pYm7smPLtEdu1erCQrLFfHYtri0H0KskIvXtMBwq8PcbDeM/ls0G qB2TW96wK0zz/ur+woURyUPofzVn1CFvhjUVW5M4ibHbLsBgW6hirLa0YRODwgjOjOQ2 rpzNd3jP6PEkYzCsOtGw5NLEHd1fnaUhhJ6meL96/WNLyGkOzqPK0qZWYlqsRUffDfsE uOwBsdCzAMwKdq9+nyZSzV9Cb9f8ydYXZUIXQqwK1hx1L8yJws7ClMefy7GVdpHZXU7L q05A== X-Gm-Message-State: ANoB5pluKN2L5HNZt1ocvYN88LTXUj+vd/tfTAFiUOdMRlYNRhp0ihS6 Y1Q+agZ+3DC/sTrVnR2UNsvzsoraS7KXR1iWZ1+Olg== X-Google-Smtp-Source: AA0mqf5ocvVJiCqY8nLnR0D0MpSo39ya6+L7QPBIX3B+9vS+N8RBQdYt70+S7GvC4eCZvk6YPLz05JNkJvMxFYoDFq8= X-Received: by 2002:aa7:c9c2:0:b0:45c:c64d:a6ac with SMTP id i2-20020aa7c9c2000000b0045cc64da6acmr7052661edt.416.1668312673182; Sat, 12 Nov 2022 20:11:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sat, 12 Nov 2022 20:11:01 -0800 Message-ID: Subject: Re: [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT) To: Philippe Altherr Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 50946 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 Sat, Nov 12, 2022 at 7:59 PM Philippe Altherr wrote: > > - The problem seems to be related to how "false && true" interacts with other constructs. > - In Zsh 5.9 the problem seems to be that compound commands now incorrectly trigger ERR_EXIT. > - In Zsh 5.8 I can't pinpoint the problem, for now. You shouldn't even be bothering with 5.8.1, it's been wrong all along; it blindly never errexits at the end of an if/then/fi. I think my patches so far have uncovered a different bug that was already present but was masked by the foregoing, which is, that noerrexit is unwound in cases where it should not be. I think this is happening at lines 1530-1531 of exec.c, right under the comment about "hairy code near the end of execif()". That's an area I didn't touch, but I'm pretty sure it's restoring noerrexit to its state before entering the "if" (oldnoerrexit) when it should be preserving the state from the "&&" conditional. In 5.8.1 this gets reversed again via this_noerrexit.