zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Very weird shell & sysread behavior
Date: Sun, 28 Oct 2018 12:59:44 +0100	[thread overview]
Message-ID: <CAKc7PVDVJ4=NHtY-wz-wxmGtjK_OuEHnrpzCpTCXNxJbUGNe+Q@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7YqnHcPvwLOOxD-3-OtO-h2_Bfo8VySP5i9g_A0xjsZ6A@mail.gmail.com>

On Sun, 28 Oct 2018 at 06:22, Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Sat, Oct 27, 2018 at 1:53 PM Sebastian Gniazdowski
> <sgniazdowski@gmail.com> wrote:
> >
> > Turned out the tricky output-parameter specifier, the '__tmp[(#__tmp +
> > 1)]' isn't correct. Apparently because #__tmp in math context is
> > character-code. Regular __tmp_size variable and '__tmp[__tmp_size +
> > 1]' works correctly, even when the data is printed in two print -r
> > instructions, not as the single string.
>
> You could also do __tmp[$#__tmp+1] if you want to avoid the extra variable.

Thanks, didn't try this. The extra variable has additional positive
effect – when increased for each 0 return from sysread, it doesn't
compute array length each read. But for 65kB reads, it probably
doesn't matter, as there will not be many of reads at all (to exhaust
the input FD).

Blinkenshell isn't responding, a more permanent and responsive link:
https://imgur.com/YGWYTLe

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

      reply	other threads:[~2018-10-28 12:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27 20:35 Sebastian Gniazdowski
2018-10-27 20:53 ` Sebastian Gniazdowski
2018-10-28  5:22   ` Bart Schaefer
2018-10-28 11:59     ` Sebastian Gniazdowski [this message]

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='CAKc7PVDVJ4=NHtY-wz-wxmGtjK_OuEHnrpzCpTCXNxJbUGNe+Q@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=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).