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.1 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 DDA8224825 for ; Fri, 29 Mar 2024 17:56:38 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711731398; b=Jhr5jbux3RmCMWxebFerc0ohi+L9AUZH26Rh+cZQO5XDEDQ2ZP9QozGcDXP5hCx0SqZVbIXVfZ 8HC8EawunxgxlSRO1AtDsmdArxAtHmXC9aFoYe013p4oXFIS2oyYCr2ATqUSEQtRZk+GgBy0ec kIBge70LCbDjtqlNGT+NqlF4Coj6N64SZ71wlgaJ5FW6EIQ8fnRm2Ir8orol9YOUSdYVjRBGbt uYWl3T/9XfSJvwBRstDAFKxu8RLae55ScL7VOW6SUUlVJiZZ/d8p1Rtywx/9tuwaNd/FH/0tKZ qIMqAuTFw7ufwfh1KvRzqIBdOO+4CK1ANylXXyY6kYBVFw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; 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=1711731398; bh=AWuyz3WrH86lO5prKtleHE/fcdct8rV9qbWhnJf1Mbg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=TUN0N4Gil9+yzcB7cPFL4Ggke5NuFvLycnrW/e+KTHbULQutSWnW3qqfXr/osYdFjd0wpVFk+Q TXXHiKQzC4gtpneFurGUgAIhxfcQS+VwUPu6RGc1nBUnnXF7A/d4OCfeb5kQBcNCO+EL6jRdpG n41WiAIQrGL5ADIlFvlIydAXrU2/Ykf7ZamvBb+h5MjZW9SkEboJf/dgj513MDBtpXcyLxqRAe UF7pdAoC1UgZuKCM+3r8KjTwGDqAB982sKjJSNbBkiZ5GeLpnfLBD9rSA82BSkgpWpHm8y438d JkUtY+KblDi1m3CyIsG0UHWP1OafU0pkGG4ZSN+As6tuPg==; 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:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=pjSKpR55LNkiSinox88xLPB9ecmw4wRPNyTRJ3uxtmk=; b=TdgFGdnVdHSNxEIy6vF1WAW8EO VmGxgESGavULfk3rXBSbbGenuJJwpihR4aJTiLiYS/PEnGV4nCw56pSPVha7Hfl0vRp0QXh/NAm84 Ruc2v5KtdgWGev0PR6sYKKX341rgzvKoaNkHVS5q3Xf+52ToqvReb3DJTaZXqbA0/7ddfTI9bLz8B dfCcFkrOx/8jGDf98gvf85n27AdvMXwJLHZj2B6rCbfs9CJCLJZTFne0LWJDB+BmkogR1qsVj7AtK lXaUrUGo2c16qTrs3V0dbFw5h+Wkt0ItcZfD7QJtLMl1ruqVPHq4Nks6bF/4rEF1oVQ/ZdCKsQ6CR qtBqIqUQ==; Received: by zero.zsh.org with local id 1rqFWv-000FRy-7D; Fri, 29 Mar 2024 16:56:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; 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-ej1-f47.google.com ([209.85.218.47]:49580) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rqFWa-000F8j-Ga; Fri, 29 Mar 2024 16:56:18 +0000 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a4e44be53feso11318266b.3 for ; Fri, 29 Mar 2024 09:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1711731376; x=1712336176; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pjSKpR55LNkiSinox88xLPB9ecmw4wRPNyTRJ3uxtmk=; b=FEXgv2wS4WqhQBV9CG/Iw+0tY27l/gVsy8LmyuvCie1BVy5D8I2JgGaCH+9ugaMKDa 5/ArpCtD63MdrcinbAihAxSuvfrH2PyCVIebNoEJRHrH1iZcvNjP2ITpkzmUmRufkk3X zA8FR6D6yAXg9xS2kRzepI9pc7SfhxXEmvX1WxwmTnf/A5f2aRdqmA2QWpK5b8iS11Nd cpPFz6cLavdDf9rlP9cf0Vn5fLdFir8y2LWAT3IRgdS0CKidd6FaCVjiiwMhGgMtUpFg mjcPltc4iTpVKgQiIU0aCfC9A3kIGDbtuazgl3Q/B8HzQbYlBCtGoUhElmEjlFDNTts+ FFKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711731376; x=1712336176; h=content-transfer-encoding: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=pjSKpR55LNkiSinox88xLPB9ecmw4wRPNyTRJ3uxtmk=; b=PeVN5WhJ1Nr92H1QcLl45I+3bSGHEDrocgFik+l/2297Ivdx2gpddYlVihBU5h/Onl Rh3HseZo5yc2R6yuoKNakyTbslSqeB//Ox9oZU81IBTj0XcdheWEmDfYyviz8U9TfyoA l30hvS6zDCH7bTx24GfanGIndNSezUqI15XlZzdNZ+2733gewm7CUD4XO/w4nyo1CxR9 Edzrg11Tn/bkiIBmnyO1ePAb34ZNUlDHKvFDULrjvHt4I/+mTYS5/hDYXSwxy5WKVNZ+ bFh+Gc4M2V8kELt4KjYDipI2g/jqEL3Xe+uDxAogps6k0ALYCFupotDKseQTfFuGo87c ipWw== X-Gm-Message-State: AOJu0YxZGWBPzvet80m5uFZGKgyewG1LVWXRVCNqiF8eG5jf2zHztqWJ MkXpQlvrIQ2LQUmDG08GF8c8BF1InwppoLWF7I28IdkMq/85Wj4D/tsvgJlIwEFZHe4Fpwmd7aF 6AKBwJ28rv2FC/RYdoC1ty48Q+Z8nucdm31LDtqY+KIfi9aM8UDBe X-Google-Smtp-Source: AGHT+IG2kUJdKqJa/i2NBlKat+2PNCkpdXH9nYTCDE9Xyw/GnRK0kQ1sshD331/FLxmh04ot0dJn+BCALtHlQC+2zGI= X-Received: by 2002:a17:906:b5a:b0:a4e:3f04:9d45 with SMTP id v26-20020a1709060b5a00b00a4e3f049d45mr849811ejg.74.1711731375704; Fri, 29 Mar 2024 09:56:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 29 Mar 2024 09:56:04 -0700 Message-ID: Subject: Re: "break" and functions To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52848 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 Fri, Mar 29, 2024 at 9:28=E2=80=AFAM Bart Schaefer wrote: > > I meant specifically the difference in behavior > between builtin and function Found it: 52151, Bug: function calls with break in preexec In exactly this same context, in fact: Adding nofork tests. No one responded, that time. On Sat, Sep 16, 2023 at 8:08=E2=80=AFAM Bart Schaefer wrote: > > [...] "set -x" shows the function call being made, but it > immediately stops without executing any commands. > > One of these cases has to be wrong: Either the loop should break > immediately, so neither the builtin nor the function runs, or the > function should run and then the loop should break. Or more > radically, a break occurring in the argument expansions should just be > discarded, but that seems wrong too. I think it's the former: The > builtin shouldn't run in this case. I suspect this comes down to "breaks" being tested at the top of execpline2(), which is called when entering a function but not when already committed to running a builtin.