zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Bug? Output not flushed?
Date: Fri, 15 Sep 2023 10:30:05 -0700	[thread overview]
Message-ID: <CAH+w=7ZiU+YY46hAVhR_8MoUmN6Mnxk8TFf9S3dgg_wkR16ajQ@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3QbXntu6F7MAcweg5m0iRXp0QmuSkdWP2DfDxNJ=TYHWg@mail.gmail.com>

On Fri, Sep 15, 2023 at 10:05 AM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> I'm not sure if that diagnosis is correct, look at this:
> % { print XXX; return 0; } >| /tmp/newfile; echo hello; print $(</tmp/newfile)
>
> ie, does the return just return from the whole statement?

Hrm.  I was trying to come up with an example that DID NOT depend on
my ${ ... } nofork patch, but the semantics of return seem to make
that impossible.

If you have my full set of nofork patches installed:

% set -vx
% print IN ${ print NOFORK; return 0; } OUT
>| /tmp/zshw44kFq { print NOFORK; return 0;  ;}
+Src/zsh:3> print NOFORK
+Src/zsh:3> return 0
REPLY="$(</tmp/zshw44kFq)"
+Src/zsh:3> print IN OUT
IN OUT

The redirection has happened, the print has happened, and the
assignment to REPLY has happened, but the file was empty when read.
Unless something is actually aborting the $(...) ... will have to dig
further.

Thanks for the observation.


  reply	other threads:[~2023-09-15 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 16:56 Bart Schaefer
2023-09-15 17:05 ` Mikael Magnusson
2023-09-15 17:30   ` Bart Schaefer [this message]
2023-09-15 22:22     ` [PATCH] ? Parse error does not always set $? (Was: Bug? Output not flushed?) Bart Schaefer
2023-09-16  1:20       ` 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=7ZiU+YY46hAVhR_8MoUmN6Mnxk8TFf9S3dgg_wkR16ajQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=mikachu@gmail.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).