zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: "break" and functions
Date: Fri, 29 Mar 2024 09:56:04 -0700	[thread overview]
Message-ID: <CAH+w=7Zgs3rPz4qtf9QHjZOn=PGgTPoZJRPz8XQz2ARUFCxprQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Zi9yfc1EFEivjf9COde0UsvRbynNNu1_f5gVZyomCc3w@mail.gmail.com>

On Fri, Mar 29, 2024 at 9:28 AM Bart Schaefer <schaefer@brasslantern.com> 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 AM Bart Schaefer <schaefer@brasslantern.com> 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.


  reply	other threads:[~2024-03-29 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  1:54 Bart Schaefer
2024-03-29  9:30 ` Mikael Magnusson
2024-03-29 16:28   ` Bart Schaefer
2024-03-29 16:56     ` Bart Schaefer [this message]
2024-03-29 17:38 ` Oliver Kiddle
2024-03-29 18:51   ` Bart Schaefer
2024-03-29 21:14     ` Mikael Magnusson
2024-03-29 22:02       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7Zgs3rPz4qtf9QHjZOn=PGgTPoZJRPz8XQz2ARUFCxprQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).