zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Zsh hackers list <zsh-workers@zsh.org>,
	Peter Stephenson <p.w.stephenson@ntlworld.com>
Subject: Re: Why sourcing a file is not faster than doing a loop with eval, zle -N
Date: Sat, 23 Dec 2017 16:01:38 +0100	[thread overview]
Message-ID: <etPan.5a3e6fd2.64b723b2.19e@zdharma.org> (raw)
In-Reply-To: <20170619215237.7e58707b@ntlworld.com>



On 19 czerwca 2017 at 22:52:37, Peter Stephenson (p.w.stephenson@ntlworld.com) wrote:
> On Mon, 19 Jun 2017 20:28:35 +0100
> Peter Stephenson wrote:
> > How about something like this? As far as I can tell, fgets is designed
> > from the ground up as Gets Done Properly, so if you have it on your
> > system it will work correctly. I can't think of a case where this
> > wouldn't do the right thing --- fgets will read at most one line and if
> > it does we were going to get the big STDIO overhead at that point
> > anyway.
> 
> I know what the problem with it is --- we can't tell the difference
> betwen a terminating '\0' and a '\0' that's part of the input stream.

We could do a pair of calls, first fgets(), then fgetc(), and this way solve this problem?

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org


  parent reply	other threads:[~2017-12-23 15:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <etPan.594513a8.516100cd.10b2e__10513.1716504276$1497699329$gmane$org@zdharma.org>
     [not found] ` <20170619122413.GA9294@chaz.gmail.com>
     [not found]   ` <170619083116.ZM17323__41722.0601499595$1497886320$gmane$org@torch.brasslantern.com>
     [not found]     ` <20170619161601.GB9294@chaz.gmail.com>
2017-06-19 19:28       ` Peter Stephenson
2017-06-19 19:57         ` Bart Schaefer
2017-06-19 20:38         ` Bart Schaefer
2017-06-19 20:44           ` Peter Stephenson
2017-06-20 11:28             ` fgets() portability (Was: Why sourcing a file is not faster than doing a loop with eval, zle -N) Stephane Chazelas
2017-06-19 20:52         ` Why sourcing a file is not faster than doing a loop with eval, zle -N Peter Stephenson
2017-06-19 23:01           ` Bart Schaefer
2017-12-15 11:01             ` Sebastian Gniazdowski
2017-12-23 15:01           ` Sebastian Gniazdowski [this message]
2017-12-23 15:47             ` Sebastian Gniazdowski
2017-12-23 22:19 Joey Pabalinas
     [not found] ` <7096.1521281564@thecus>
2018-03-19  9:07   ` Joey Pabalinas
2018-03-19 14:24     ` Sebastian Gniazdowski
2018-03-20  5:14       ` Joey Pabalinas

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=etPan.5a3e6fd2.64b723b2.19e@zdharma.org \
    --to=psprint@zdharma.org \
    --cc=p.w.stephenson@ntlworld.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).